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

微信小程序集成出错 #153

Closed
Richard-Choooou opened this issue Feb 27, 2018 · 12 comments
Closed

微信小程序集成出错 #153

Richard-Choooou opened this issue Feb 27, 2018 · 12 comments

Comments

@Richard-Choooou
Copy link

提示
VM3616:1 thirdScriptError
sdk uncaught third Error
Cannot read property 'navigator' of undefined
TypeError: Cannot read property 'navigator' of undefined
编辑源码
打印window,输入undefind

@Maizify
Copy link
Collaborator

Maizify commented Feb 27, 2018

没太明白,你是怎么集成、操作的?

@Richard-Choooou
Copy link
Author

说来也是搞笑,我在微信小程序社区里反馈一个问题,如何获取微信基础库版本的提示是打开vconsole查看,我第一时间想到你们开发的这个工具库,结果他们说的vconsole指的是微信开发工具的调试工具。。。

@Richard-Choooou
Copy link
Author

你还是和小程序部门的人说说吧。。。

@Maizify
Copy link
Collaborator

Maizify commented Feb 27, 2018

请描述下详情吧。你是在小程序内开启了vConsole,然后里面显示了上面的error?

@Richard-Choooou
Copy link
Author

是的,应该是小程序运行时已经转换成native环境,然后就没有window了吧

@Maizify
Copy link
Collaborator

Maizify commented Feb 27, 2018

vConsole的环境里是有window对象的,开发者的业务代码里是没window对象的。你是否在某些地方调用了window对象呢?

@Richard-Choooou
Copy link
Author

代码里没有调用过window,但是vconsole.js里使用过window对象,所以提示vconsole.js里出错,你可以尝试下

@Maizify
Copy link
Collaborator

Maizify commented Feb 28, 2018

是不是直接在自己代码里import了vConsole?

@Richard-Choooou
Copy link
Author

是的

@Maizify
Copy link
Collaborator

Maizify commented Mar 7, 2018

不需要自行import vconsole,小程序底层框架已直接集成有vConsole,在右上角菜单中“打开调试”即可。

@Maizify Maizify closed this as completed Apr 9, 2018
@wangxiaowen940104
Copy link

微信小程序里面可以使用vconsole.min.js吗?我也出现了同样的错误

@Maizify
Copy link
Collaborator

Maizify commented Aug 20, 2018

@wangxiaowen940104 不需要自行引入vconsole.min.js,小程序小游戏已经自带有vConsole了,在右上角菜单中“打开调试”即可。

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

3 participants