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

npm run dev:weapp 报错 #438

Closed
guotie opened this issue Aug 9, 2018 · 3 comments
Closed

npm run dev:weapp 报错 #438

guotie opened this issue Aug 9, 2018 · 3 comments

Comments

@guotie
Copy link
Contributor

guotie commented Aug 9, 2018

npm run dev:weapp的问题

  1. 创建项目后,使用 npm run dev:weapp 运行正常;
  2. 增加一个page,重启 npm run dev:weapp,微信工具报错;
  3. 删除该page,微信工具任然报错
  4. 但是,使用 npm run build:weapp, 微信工具没有报错

微信开发工具报错如下:

VM1378:1 thirdScriptError 
 sdk uncaught third Error 
 module "npm/@tarojs/taro-weapp/index.js" is not defined 
 Error: module "npm/@tarojs/taro-weapp/index.js" is not defined
    at require (http://127.0.0.1:44217/appservice/__dev__/WAService.js:19:19934)
    at http://127.0.0.1:44217/appservice/__dev__/WAService.js:19:19682
    at http://127.0.0.1:44217/appservice/app.js:12:18
    at require (http://127.0.0.1:44217/appservice/__dev__/WAService.js:19:20075)
    at http://127.0.0.1:44217/appservice/appservice?t=1533780422695:1007:9
console.error @ VM1378:1
(anonymous) @ WAService.js:14
(anonymous) @ WAService.js:5
a @ appservice?t=1533780422695:1003
window.onerror @ VM1378:1
VM1378:1 thirdScriptError 
 sdk uncaught third Error 
 module "npm/@tarojs/taro-weapp/index.js" is not defined 
 Error: module "npm/@tarojs/taro-weapp/index.js" is not defined
    at require (http://127.0.0.1:44217/appservice/__dev__/WAService.js:19:19934)
    at http://127.0.0.1:44217/appservice/__dev__/WAService.js:19:19682
    at http://127.0.0.1:44217/appservice/pages/index/index.js:12:18
    at require (http://127.0.0.1:44217/appservice/__dev__/WAService.js:19:20075)
    at http://127.0.0.1:44217/appservice/appservice?t=1533780422695:1011:9

dist目录下的npm/@tarojs/taro-weapp/index.js是存在的。

文件监听的问题

好像没有对增加目录、增加文件进行监听,增加pages后,必须重启;

系统信息

  • 操作系统: [e.g. Windows 10]

  • Taro 版本 [e.g. v.0.0.64]
    0.0.73

  • Node.js 版本 [e.g. v9.0.0]
    8.9

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

@luckyadam
Copy link
Member

本地依赖包没有装好

@guotie
Copy link
Contributor Author

guotie commented Aug 9, 2018

不是本地依赖包的问题,npm run build:weapp 是可以用的。

似乎是微信开发工具的问题,重启微信开发工具,就可以了

@guotie guotie closed this as completed Aug 9, 2018
@JianwenXu
Copy link

我遇到的情况是 运行npm run dev:weapp 在powershelle上没有错误,但是在微信开发者工具上面经常报错“sdk uncaught third Error ”,多次重新编译错误的具体位置都不一样,但是多编译几次就好了,但是刚才尝试了一下,重启开发者工具也没问题了,有人知道这个到底是为什么吗。虽然不是必现的,但是觉得出现的频率还挺高的,求解答

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