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

TypeError: Cannot read property '0' of undefined #332

Closed
kenberkeley opened this issue Jul 16, 2018 · 4 comments
Closed

TypeError: Cannot read property '0' of undefined #332

kenberkeley opened this issue Jul 16, 2018 · 4 comments

Comments

@kenberkeley
Copy link

kenberkeley commented Jul 16, 2018

npm run dev:weapp 以及 npm run build:weapp 都没问题,但换成 h5 就会报如下错误:

TypeError: Cannot read property '0' of undefined
    at new Parser (C:\Users\username\Desktop\projectname\node_modules\babylon\lib\index.js:1577:45)

该错误仅针对某个文件

@kenberkeley
Copy link
Author

Module not found: Can't resolve xxx

经调查,原来是 .temp 中不存在该文件

@kenberkeley
Copy link
Author

也就是说,src 中的该文件并没有被复制到 .temp

@kenberkeley
Copy link
Author

#289

@kenberkeley
Copy link
Author

kenberkeley commented Jul 16, 2018

解决方案:把该文件重命名即可(例如 src/utils/{isWeapp.js => isH5.js}

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

1 participant