question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack failed: Module parse failed: Unexpected token (1:918)

See original GitHub issue

Webpack failed then importing setupPlugins

image

Seems like don’t have webpack loader

I am using babel 6

module: { rules: [ ...styles.loaders({useDevServer: true}), { test: /\.js?$/, exclude: /(node_modules)/, loaders: [ 'babel-loader?presets[]=react,presets[]=es2015,presets[]=stage-0' ] }, { test: /\.(jsx)?$/i, loader: 'babel-loader', options: { presets: [ 'react', 'stage-0', 'es2015', ], comments: false, plugins: [ 'react-hot-loader/babel', 'transform-flow-strip-types', 'transform-class-properties', config.webpack.flowRuntimeEnabled ? ['flow-runtime', { assert: false, warn: false, annotate: true, }] : null, 'transform-decorators-legacy', ].filter((plugin) => plugin != null), }, exclude: [ /node_modules/, /\.(spec|e2e)\.js$/, ], }, ], },

.babelrc { "presets": [ "stage-0", "react", "es2015", "flow" ], "env": { "production": { "presets": [ "babili" ] } }, "compact": true, "plugins": [ "transform-flow-strip-types", "transform-react-jsx", "transform-object-rest-spread", "git-version", "transform-class-properties" ] }

Environment

superset version: superset version 0.32.0rc2.dev2 python version: python --version 3.6.7 node.js version: node -v v8.16.0 npm version: npm -v 6.4.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
KirillYoYocommented, Jun 7, 2019

Hello, I try started it locally, with my webpack config…Update to babel 7 do nothing for me… { test: /\.js?$/, exclude: /(node_modules)/, loaders: [ 'babel-loader?presets[]=react,presets[]=es2015,presets[]=stage-0' ] }, { test: /\.(jsx)?$/i, loader: 'babel-loader', options: { presets: [ 'react', 'stage-0', 'es2015', ], comments: false, plugins: [ 'react-hot-loader/babel', 'transform-flow-strip-types', 'transform-class-properties', config.webpack.flowRuntimeEnabled ? ['flow-runtime', { assert: false, warn: false, annotate: true, }] : null, 'transform-decorators-legacy', ].filter((plugin) => plugin != null), }, exclude: [ /node_modules/, /\.(spec|e2e)\.js$/, ], },

0reactions
srinivasjavvadicommented, Apr 16, 2020

Same issue i am facing in superset-ui-plugins demo run. Please help me. how to resolve

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 4: Module parse failed: Unexpected token
During my builds, webpack is giving me this error: ERROR in ./client/components/App/index.tsx 15:9 Module parse failed: Unexpected token ...
Read more >
Module parse failed: Unexpected token. You may need an ...
You're trying to use ui-kitten in react-native-web (or expo-web in this case), and you need to make Webpack transpile node_modules or you'll face...
Read more >
module parse failed: unexpected token (1:0) you may need an ...
1 Answer. Sorted by: 7. Apparently it happened because you have two module properties in the webpack config object. Given JS objects can...
Read more >
Odyssey Lift-off I: "Module parse failed: Unexpected token" Error
You may need an appropriate loader to handle this file type. Looks like webpack is unhappy for some reason. Could be a few...
Read more >
Module parse failed: Unexpected token (1:0) - Laracasts
Hello , After running npm run watch I see this error : ERROR in ./resources/js/components/irp/admin/EditGroup.vue 1:0 Module parse failed: Unexpected token ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found