Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地使用Strophe.js进行即时通讯操作正常,打包后报错 #2776

Closed
zhengmingze opened this issue Nov 22, 2019 · 1 comment
Closed

Comments

@zhengmingze
Copy link

Bug report(问题描述)

本地使用Strophe.js组件正常,使用npm install Strophe.js命令引入,打包后使用服务器则报错

Screenshot or Gif(截图或动态图)

本地正常情况会发出长轮询
image
打包后提示
image

@zhengmingze
Copy link
Author

通过对比打包前与本地的代码,发现引入了mock.js后,浏览器new XmlHttpRequest时,调用的是mock.js里的方法,不知是什么原因,可能是加载机制的问题。Strophe.js是基于XmlHttpRequest发起请求的,因此去除mock.js的相关依赖和代码就可以了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant