superset icon indicating copy to clipboard operation
superset copied to clipboard

Module parse failed

Open hustxiaofeng opened this issue 10 years ago • 13 comments

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 avatar Nov 03 '16 05:11 hustxiaofeng

node version 6.9.1 npm version 3.10.8

hustxiaofeng avatar Nov 03 '16 05:11 hustxiaofeng

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 avatar Nov 06 '16 15:11 mistercrunch

@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

hustxiaofeng avatar Nov 07 '16 02:11 hustxiaofeng

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

wo8000 avatar Nov 07 '16 07:11 wo8000

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

toabey avatar Nov 07 '16 09:11 toabey

can anybody solve this problem?

huanruiqi avatar Nov 08 '16 07:11 huanruiqi

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

dennybiasiolli avatar Nov 08 '16 20:11 dennybiasiolli

is it fixed??

wo8000 avatar Nov 14 '16 07:11 wo8000

thank you!! @toabey

wo8000 avatar Nov 16 '16 08:11 wo8000

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

TingYinHelen avatar Nov 25 '16 05:11 TingYinHelen

@toabey Thank you

TingYinHelen avatar Nov 25 '16 06:11 TingYinHelen

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?

zoiew avatar Dec 23 '16 10:12 zoiew

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.

mistercrunch avatar Apr 23 '18 17:04 mistercrunch