Skip to content

h5 预览报错 #423

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

Closed
shaodahong opened this issue Feb 26, 2019 · 8 comments
Closed

h5 预览报错 #423

shaodahong opened this issue Feb 26, 2019 · 8 comments

Comments

@shaodahong
Copy link
Contributor

执行 yarn dev:h5

ℹ️  Listening at http://127.0.0.1:10086/

监听文件修改中...

🙅   Failed to compile.

./node_modules/taro-ui/dist/h5/components/countdown/index.js 105:11
Module parse failed: Unexpected token (105:11)
You may need an appropriate loader to handle this file type.
|     } = this.state;
| 
>     return <View className={classNames({
|       'at-countdown': true,
|       'at-countdown--card': isCard

版本

"taro-ui": "^2.0.1"
"@tarojs/cli": "1.2.14",
@koppthe
Copy link
Collaborator

koppthe commented Feb 26, 2019

麻烦重新看看「快速上手」一章的文档,需要增加一个配置项 esnextModules

@koppthe koppthe closed this as completed Feb 26, 2019
@sananiki
Copy link

sananiki commented Mar 1, 2019

加了也是报这样的错

@shaodahong
Copy link
Contributor Author

@sananiki 我加了可以了,你发下配置看看,是不是写错了地方

@sananiki
Copy link

sananiki commented Mar 1, 2019

@sananiki 我加了可以了,你发下配置看看,是不是写错了地方

module.exports = {
env: {
NODE_ENV: '"development"'
},
defineConstants: {
},
weapp: {},
h5: {
esnextModules: ['taro-ui']
}
}

@shaodahong
Copy link
Contributor Author

@sananiki 我也是这样加的,不过是加到 config/index.js 中的

@sananiki
Copy link

sananiki commented Mar 1, 2019

@sananiki 我也是这样加的,不过是加到 config/index.js 中的

我dev,index.prod都加了,还是谢谢你了,我再查下

@maskwang
Copy link

maskwang commented Mar 9, 2019

@sananiki 解决了嘛? 我加了配置, 也同样报错。。

@bigbigqiang
Copy link

加了配置 taro-ui 版本号 2.0.2, h5预览样式乱掉,微信小程序正常

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

5 participants