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

引入插件报错 #9

Closed
lsw1990 opened this issue Aug 18, 2018 · 15 comments
Closed

引入插件报错 #9

lsw1990 opened this issue Aug 18, 2018 · 15 comments

Comments

@lsw1990
Copy link

lsw1990 commented Aug 18, 2018

[non-writable] modification of global variable "wx" is not allowed when using plugins at app.json.
console.error @ VM2122:1
set @ WAService.js:3
module.exports @ wxApiInterceptors.js? [sm]:30
(anonymous) @ app.js? [sm]:4
require @ WAService.js:19
(anonymous) @ appservice?t=1534596564626:1923

[non-writable] modification of global variable "wx.request" is not allowed when using plugins at app.json.
console.error @ VM2122:1
set @ WAService.js:3
module.exports @ wxApiInterceptors.js? [sm]:233
(anonymous) @ app.js? [sm]:4
require @ WAService.js:19
(anonymous) @ appservice?t=1534596564626:1923

@mushan0x0 请修复一下呗,用的wxParser插件引起的,微信后台添加的插件,我发现用任何插件都会报这个错误,注:是微信后台添加的插件
这个问题导致后续用您的都报错,找不到then,目前不能同时用插件和你这个,很纠结,老哥能不能尽快修复一下,急用

@mushan0x0
Copy link
Owner

@lsw1990 你暂时把基础库版本设置为2.0.8吧,具体的我再看看怎么解决

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

十分感谢,能不能不要拦截插件的

@mushan0x0
Copy link
Owner

@lsw1990 微信这样设计应该是为了安全,防止一些插件修改wx一些接口搞小动作。不过我觉得微信多此一举了。我现在就打算配一个参数,然后不拦截wx对象,而是返回一个拦截后的对象。

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

好的,十分感谢,能出来我测试一下

@mushan0x0
Copy link
Owner

@lsw1990 好了更新了,你看下文档最后面

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

好的,我测试一下

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

这个需要改动以前的代码吗?

@mushan0x0
Copy link
Owner

@lsw1990 是的,只能这样了

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

那就很纠结了,我别的地方大量用了类似的,但是我主要用的别的api,没有用wx.request

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

意思我在别的地方点用需要app.wx了吗?

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

第一个参数我没用到过

@mushan0x0
Copy link
Owner

@lsw1990 你也可以挂到wx.newWx上,就不用getApp()了,第一个参数没使用你就传一个{}就行了

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

挂到wx什么意思,能否提供一个示例,小程序这部分有点蛋痛

@mushan0x0
Copy link
Owner

@lsw1990 示例我更新了,你看下吧

@lsw1990
Copy link
Author

lsw1990 commented Aug 20, 2018

好的,十分感谢

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

2 participants