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

modification of global variable "App" is not allowed when using plugins at app.json. #8

Open
myzingy opened this issue Feb 28, 2019 · 2 comments

Comments

@myzingy
Copy link

myzingy commented Feb 28, 2019

小程序 app.ison 中引入了插件,项目需要;

然后 require xbossdebug 时就会报错:
[non-writable] modification of global variable "App" is not allowed when using plugins at app.json.
[non-writable] modification of global variable "Page" is not allowed when using plugins at app.json.

我看到这边是在重写 App 和 Page ,有没有什么变通方式?

@zhengguorong
Copy link
Owner

嗯,这个库重写了App和Page 方法,插件模式有限制,可以参考https://github.com/zhengguorong/xbosstrack-wechat/blob/master/src/wrapper.js这个文件,通过包装增强的方式注入

@myzingy
Copy link
Author

myzingy commented Feb 28, 2019

我给小程序官方提了bug,他们回复说正考虑放开这个限制;

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