Webpack error "Unexpected token"
See original GitHub issueHi,
I just cloned and tried to build the starter kit, but there seems to be an error with webpack.
ERROR in ./source/components/hello/index.js Module parse failed: C:.…/source\components\hello\index.js Unexpected token (9:6) You may need an appropriate loader to handle this file type. SyntaxError: Unexpected token (9:6)
I have tracked down the cause of this to the webpack.config.dev.js
and webpack.config.prod.js
files. The line that triggers the error is :
include: path.join(__dirname, 'source')
As soon as I remove that line (actually replacing it with an exclude of node_modules
instead), the projet build and runs perfectly.
Do you have any idea what causes this ?
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Webpack Build SyntaxError: Unexpected token - Stack Overflow
Webpack Build SyntaxError: Unexpected token ) ; import React from ; function App ; <div> <h2>Welcome to My new React App</h2> <h3>Date :...
Read more >"SyntaxError: Unexpected token ." in webpack script · Issue #64
Hello, I have the following configuration: node 10.16.0 electron 3.0.2 webpack 4.20.2 webpack-node-externals 1.7.2 When adding the line ...
Read more >Syntax Error: Unexpected token while bundling with webpack
Greetings, My question is related to configuration of babel/webpack to be able to use nodeJS modules - and unrelated to K6 as such....
Read more >Webpack lesson - Uncaught SyntaxError: Unexpected token ...
Why do I get "Uncaught SyntaxError: Unexpected token import"? Compiling works ok. I am doing this lessons https://laracasts.com/series/webpack-for-everyone/ ...
Read more >Unhandled Runtime Error SyntaxError: Unexpected token ...
Hi All, I have been trying to setup and run the headless setup powered by the Atlas Add-on and it proving rather difficult....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Burgi0101 It should at least be compatible with Windows according to Node’s documentation: https://nodejs.org/api/path.html
@ericelliott I’ll search around if I can find a reason as to why it doesn’t work, if I don’t find anything I’ll send a PR for the workaround!
Thanks for your time guys!
Are we sure that the path module is cross platform compatible?