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

开发者工具编译报错 #273

Closed
JZLeung opened this issue Jul 22, 2017 · 6 comments
Closed

开发者工具编译报错 #273

JZLeung opened this issue Jul 22, 2017 · 6 comments

Comments

@JZLeung
Copy link

JZLeung commented Jul 22, 2017

WAService.js:9 Uncaught TypeError: Cannot set property 'Promise' of undefined(anonymous function) @ index.js [sm]:4require @ WAService.js:9(anonymous function) @ WAService.js:9(anonymous function) @ app.js [sm]:3require @ WAService.js:9(anonymous function) @ app.js:160
base.js [sm]:133 Uncaught TypeError: Cannot read property '$pages' of undefined$createPage @ base.js [sm]:133(anonymous function) @ index.js:97require @ WAService.js:9(anonymous function) @ index.js:99
appservice:16 Sat Jul 22 2017 12:10:59 GMT+0800 (CST) page 编译错误
appservice:17  pages/index 出现脚本错误或者未正确调用 Page()

代码没动过,直接watch就报错了。

@afeiship
Copy link
Contributor

afeiship commented Jul 22, 2017

可以试试以下几步:

使用微信开发者工具新建项目,本地开发选择dist目录。
微信开发者工具-->项目-->关闭ES6转ES5。重要:漏掉此项会运行报错。
微信开发者工具-->项目-->关闭上传代码时样式自动补全 重要:某些情况下漏掉此项会也会运行报错。
微信开发者工具-->项目-->关闭代码压缩上传 重要:开启后,会导致真机computed, props.sync 等等属性失效。#270
项目根目录运行wepy build --watch,开启实时编译。

如果还不行,可以把微信开发工具里项目删除,再重新建立。(微信这工具问题比较多)

@Gcaufy Gcaufy closed this as completed Jul 23, 2017
@encorehe
Copy link

@JZLeung 你这个问题解决没有啊 我也碰到这个问题了

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jan 25, 2018

楼上已经答了这个问题

@PolluxLee
Copy link

找了很久才发现在 “微信开发者工具===>设置===>项目设置” 里面

@zhouyao1994
Copy link

@PolluxLee 谢谢提醒,我也遇到同样的问题

@xiaomizhou66
Copy link
Contributor

"setting": { "urlCheck": true, "es6": false, "postcss": false, "minified": false, "newFeature": false },

wepy-cli生成的project.config.json文件内容不正确,用开发者工具打开 的文件都设置为true了应该是。
把这个文件设置正确,就不会有问题了。

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

7 participants