react-css-modules-boilerplate
react-css-modules-boilerplate copied to clipboard
doesn't work; webpack blows up
C:\Code\react-tests>node -v
v6.3.1
C:\Code\react-tests>npm -v
3.10.3
C:\Code\react-tests>git clone [email protected]:robinrendle/react-css-modules-boilerplate.git
...etc.
C:\Code\react-tests>cd react-css-modules-boilerplate
C:\Code\react-tests\css-modules-boilerplate>npm install
...etc...
C:\Code\react-tests\css-modules-boilerplate>npm start
The following is returned:
C:\Code\react-tests\react-css-modules-boilerplate>npm start
> [email protected] start C:\Code\react-tests\react-css-modules-boilerplate
> webpack && npm run dev
Hash: cef380419c558f0a307d
Version: webpack 1.13.2
Time: 51ms
[0] ./src/router.js 0 bytes [built] [failed]
ERROR in ./src/router.js
Module parse failed: C:\Code\react-tests\react-css-modules-boilerplate\src\router.js Unexpected token (18:12)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (18:12)
at Parser.pp$4.raise (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:2221:15)
at Parser.pp.unexpected (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:603:10)
at Parser.pp$3.parseExprAtom (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1822:12)
at Parser.pp$3.parseExprSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1715:21)
at Parser.pp$3.parseMaybeUnary (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1692:19)
at Parser.pp$3.parseExprOps (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1597:21)
at Parser.pp$3.parseExprList (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:2165:22)
at Parser.pp$3.parseSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1741:35)
at Parser.pp$3.parseExprSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1718:17)
at Parser.pp$3.parseMaybeUnary (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1692:19)
at Parser.pp$3.parseExprOps (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1597:21)
at Parser.pp$1.parseVar (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1034:28)
at Parser.pp$1.parseVarStatement (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:917:10)
at Parser.pp$1.parseStatement (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:706:19)
at Parser.pp$1.parseBlock (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:981:25)
at Parser.pp$3.parseFunctionBody (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:2105:24)
at Parser.pp$1.parseFunction (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1065:10)
at Parser.pp$3.parseExprAtom (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1810:19)
at Parser.pp$3.parseExprSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1715:21)
at Parser.pp$3.parseMaybeUnary (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1692:19)
at Parser.pp$3.parseExprOps (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1597:21)
at Parser.pp$3.parseExprList (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:2165:22)
at Parser.pp$3.parseSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1741:35)
at Parser.pp$3.parseExprSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1718:17)
ERROR in Error: Source file not found: "main"
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\static-site-generator-webpack-plugin\index.js:25:15)
at Compiler.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:71:13)
at Compiler.emitAssets (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:226:7)
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:184:10)
at C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:403:12
at Compiler.next (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:67:11)
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\CachePlugin.js:40:4)
at Compiler.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:71:13)
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:400:9)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:577:13)
at Compilation.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:60:69)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:572:10)
at Compilation.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:60:69)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:567:9)
at Compilation.next (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:67:11)
at ExtractTextPlugin.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\extract-text-webpack-plugin\index.js:309:4)
at Compilation.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:71:13)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:563:8)
at Compilation.next (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:67:11)
at ExtractTextPlugin.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\extract-text-webpack-plugin\index.js:285:5)
at C:\Code\react-tests\react-css-modules-boilerplate\node_modules\extract-text-webpack-plugin\node_modules\async\lib\async.js:52:16
at Object.async.forEachOf.async.eachOf (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\extract-text-webpack-plugin\node_modules\async\lib\async.js:236:30)
at Object.async.forEach.async.each (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\extract-text-webpack-plugin\node_modules\async\lib\async.js:209:22)
at ExtractTextPlugin.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\extract-text-webpack-plugin\index.js:237:10)
at Compilation.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:71:13)
at Compilation.seal (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:525:7)
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:397:15)
at C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:103:11
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:445:10)
at Compilation.errorAndCallback (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:344:3)
> [email protected] dev C:\Code\react-tests\react-css-modules-boilerplate
> webpack-dev-server --progress --colors
0% compile http://localhost:8080/webpack-dev-server/
webpack result is served from /
content is served from C:\Code\react-tests\react-css-modules-boilerplate
Hash: cef380419c558f0a307d
Version: webpack 1.13.2
Time: 77ms
ERROR in ./src/router.js
Module parse failed: C:\Code\react-tests\react-css-modules-boilerplate\src\router.js Unexpected token (18:12)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (18:12)
at Parser.pp$4.raise (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:2221:15)
at Parser.pp.unexpected (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:603:10)
at Parser.pp$3.parseExprAtom (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1822:12)
at Parser.pp$3.parseExprSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1715:21)
at Parser.pp$3.parseMaybeUnary (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1692:19)
at Parser.pp$3.parseExprOps (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1597:21)
at Parser.pp$3.parseExprList (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:2165:22)
at Parser.pp$3.parseSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1741:35)
at Parser.pp$3.parseExprSubscripts (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1718:17)
at Parser.pp$3.parseMaybeUnary (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1692:19)
at Parser.pp$3.parseExprOps (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1597:21)
at Parser.pp$1.parseVar (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\acorn\dist\acorn.js:1034:28)
ERROR in Error: Source file not found: "main"
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\static-site-generator-webpack-plugin\index.js:25:15)
at Compiler.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:71:13)
at Compiler.emitAssets (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:226:7)
at Watching.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:54:18)
at C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:403:12
at Compiler.next (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:67:11)
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\CachePlugin.js:40:4)
at Compiler.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:71:13)
at Compiler.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compiler.js:400:9)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:577:13)
at Compilation.next (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:67:11)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\ProgressPlugin.js:69:5)
at Compilation.applyPluginsAsync (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:71:13)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\Compilation.js:572:10)
at Compilation.next (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\tapable\lib\Tapable.js:67:11)
at Compilation.<anonymous> (C:\Code\react-tests\react-css-modules-boilerplate\node_modules\webpack\lib\ProgressPlugin.js:65:5)
webpack: bundle is now VALID.
[BS] Proxying: http://localhost:8080
[BS] Access URLs:
-------------------------------------
Local: http://localhost:3000
External: *snip*
-------------------------------------
UI: http://localhost:3001
UI External: *snip*
-------------------------------------
All I see after visiting the URL is a directory listing.
change the line include: __dirname + '/src' in webpack.config.js for include: path.join(__dirname,'src') so that the constructed path is compatible with your system
Same problem on Windows 10. @escKeyStroke, thanks for the solution!