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

Module parse failed #1533

Closed
hustxiaofeng opened this issue Nov 3, 2016 · 13 comments
Closed

Module parse failed #1533

hustxiaofeng opened this issue Nov 3, 2016 · 13 comments
Labels
#bug:cant-reproduce Bugs that cannot be reproduced

Comments

@hustxiaofeng
Copy link

hustxiaofeng commented Nov 3, 2016

after npm install, then excute 'npm run dev', it throws error as follow:

ERROR in ./~/react-map-gl/src/overlays/scatterplot.react.js
Module parse failed: /home/fwyan/caravel-master/caravel/assets/node_modules/react-map-gl/src/overlays/scatterplot.react.js Unexpected token (112:6)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (112:6)
@hustxiaofeng
Copy link
Author

node version 6.9.1
npm version 3.10.8

@mistercrunch
Copy link
Member

I looked at the line reference and it looks like a jsx statement is in there while the file doesn't have jsx extension. I can't recreate the issue but I'd look in the direction of how webpack supports jsx in non-jsx file.

@mistercrunch mistercrunch added the #bug:cant-reproduce Bugs that cannot be reproduced label Nov 6, 2016
@hustxiaofeng
Copy link
Author

hustxiaofeng commented Nov 7, 2016

@mistercrunch , this issue is same as mine, but my borowser console still show error, all related about dataTable, i find that in the dist js files, for example, in dist/dashboard.xx.js, the datatable.net.bs is loaded as AMD:
image

the if statement get a true const, but in datatable.net.bs's node modules, the if statement is a express as "typeof define === 'function' && define.amd", the npm run dev replace the express as 'true' in output dist js, i attemp to modify it as false in dist js file, and then it works well, but i don't know what cause the issue. i find other js error almost the same related to datatable in webpack:
image

@wo8000
Copy link

wo8000 commented Nov 7, 2016

me too,
npm run prod
ERROR in ./~/.1.7.2@react-map-gl/src/overlays/scatterplot.react.js
Module parse failed: /data/caravel-airbnb_prod.0.11.0.6/caravel/assets/node_modules/.1.7.2@react-map-gl/src/overlays/scatterplot.react.js Unexpected token (112:6)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (112:6)

How to solve??@hustxiaofeng

@toabey
Copy link

toabey commented Nov 7, 2016

inside mapbox.jsx
you can change 'react-map-gl/src/overlays/scatterplot.react.js' to
'react-map-gl/dist/overlays/scatterplot.react.js' and try

@huanruiqi
Copy link

can anybody solve this problem?

@dennybiasiolli
Copy link
Contributor

Have you tryed "rm -rf node_modules" and then "npm install"?

@wo8000
Copy link

wo8000 commented Nov 14, 2016

is it fixed??

@wo8000
Copy link

wo8000 commented Nov 16, 2016

thank you!! @toabey

@TingYinHelen
Copy link

I met the same problem. @dennybiasiolli I tried many times but still not work:(

@TingYinHelen
Copy link

@toabey Thank you

@zoiew
Copy link

zoiew commented Dec 23, 2016

when "npm run dev" find Error,

ERROR in .//.15.3.2@react-dom/index.js
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in /Users/zoiew/Downloads/superset-master/superset/assets/node_modules/.15.3.2@react-dom
@ ./
/.15.3.2@react-dom/index.js 3:17-46

how can i solve this problem?

@mistercrunch
Copy link
Member

Notice: this issue has been closed because it has been inactive for 486 days. Feel free to comment and request for this issue to be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug:cant-reproduce Bugs that cannot be reproduced
Projects
None yet
Development

No branches or pull requests

8 participants