jpsierens / webpack-react-redux

A boilerplate for playing around with react, redux and react-router with the help of webpack.
MIT License
599 stars 196 forks source link

npm run build fails #14

Closed efredine closed 7 years ago

efredine commented 7 years ago

On OS-X, node 6.9.1, npm 3.10.8. Runs ok with the commits prior to the Jan 16 ones.

The error output:

Module build failed: ReferenceError: window is not defined
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/footer.scss:159:31
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/footer.scss:154:48
    at module.exports (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/footer.scss:176:69)
    at Object.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/footer.scss:54:37)
    at __webpack_require__ (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/footer.scss:21:30)
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/footer.scss:41:18
    at Object.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/footer.scss:44:10)
    at Module._compile (module.js:570:32)
    at Object.exec (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack-core/lib/NormalModuleMixin.js:88:7)
    at Object.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/extract-text-webpack-plugin/loader.js:97:22)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:214:10)
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:403:12
    at Compiler.next (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:67:11)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/extract-text-webpack-plugin/loader.js:78:5)
    at Compiler.next (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:69:14)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/CachePlugin.js:40:4)
    at Compiler.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:71:13)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:400:9)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:577:13)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:572:10)
    at Compilation.next (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:67:11)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:140:4)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:567:9)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:563:8)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.seal (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:525:7)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:397:15)

ERROR in ./app/styles/filterableTable.scss
Module build failed: ReferenceError: window is not defined
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/filterableTable.scss:159:31
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/filterableTable.scss:154:48
    at module.exports (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/filterableTable.scss:176:69)
    at Object.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/filterableTable.scss:54:37)
    at __webpack_require__ (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/filterableTable.scss:21:30)
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/filterableTable.scss:41:18
    at Object.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/style-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/css-loader/index.js?modules&localIdentName=[name]---[local]---[hash:base64:5]!/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/sass-loader/index.js!/Users/ericfredine/lighthouse/projects/react-tetris/app/styles/filterableTable.scss:44:10)
    at Module._compile (module.js:570:32)
    at Object.exec (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack-core/lib/NormalModuleMixin.js:88:7)
    at Object.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/extract-text-webpack-plugin/loader.js:97:22)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:214:10)
    at /Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:403:12
    at Compiler.next (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:67:11)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/extract-text-webpack-plugin/loader.js:78:5)
    at Compiler.next (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:69:14)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/CachePlugin.js:40:4)
    at Compiler.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:71:13)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:400:9)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:577:13)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:572:10)
    at Compilation.next (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:67:11)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:140:4)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:567:9)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:563:8)
    at Compilation.applyPluginsAsync (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.seal (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compilation.js:525:7)
    at Compiler.<anonymous> (/Users/ericfredine/lighthouse/projects/react-tetris/node_modules/webpack/lib/Compiler.js:397:15)
efredine commented 7 years ago

Submitted pull request with a change that fixed it for me.

flocks commented 7 years ago

I had the exact same issue with node v7.4.0 and npm 4.0.5 and your change in your pull request @efredine fixed it, thx :)

jpsierens commented 7 years ago

Merged your PR, thanks!