css-loader: Module build failed: ReferenceError: Promise is not defined
Hi all,
I try to update some of my npm packages, and then I’m having this issues.
ERROR in ./~/css-loader!./~/sass-loader!./src/style/components/home.scss
Module build failed: ReferenceError: Promise is not defined
at LazyResult.async (/Users/roy/development/stash/chaas-web/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:152:31)
at LazyResult.then (/Users/roy/development/stash/chaas-web/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:75:21)
at processCss (/Users/roy/development/stash/chaas-web/node_modules/css-loader/lib/processCss.js:174:5)
at Object.module.exports (/Users/roy/development/stash/chaas-web/node_modules/css-loader/lib/loader.js:22:2)
@ ./src/style/components/home.scss 4:14-127 13:2-17:4 13:2-17:4 14:20-133
And the following is my package.json
"devDependencies": {
"assets-webpack-plugin": "2.2.x",
"babel-jest": "5.3.x",
"css-loader": "0.19.x",
"file": "0.2.x",
"file-loader": "0.8.x",
"html-webpack-plugin": "1.6.x",
"image-webpack-loader": "1.6.x",
"imagemin": "3.2.x",
"jest-cli": "0.5.x",
"jsx-loader": "0.13.x",
"node-sass": "3.3.x",
"react-hot-loader": "1.3.x",
"react-proxy-loader": "0.3.x",
"react-tools": "0.13.x",
"sass-loader": "2.0.x",
"style-loader": "0.12.x",
"webpack": "1.12.x",
"webpack-dev-server": "1.11.x"
},
And this is my webpack config for the scss
{ test: /\.scss$/, loader: "style-loader!css-loader!sass-loader" }
Anyone have idea and much appreciated, thanks.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 35 (2 by maintainers)
Commits related to this issue
- Downgrade css-loader to ^0.18.0 As per suggestion in https://github.com/webpack/css-loader/issues/145 Change-Id: I45abfa4236f169277156cb4b453106c10e5bf407 — committed to PorkChopClub/porkchop by jhawthorn 9 years ago
- Fixed webpack build failed Webpack build was failed because of https://github.com/webpack/css-loader/issues/145 — committed to pashamesh/videojs-chapter-thumbnails by pashamesh 9 years ago
- Downgrade cssLoader because of bug 'Promise is not defined' — committed to triforkse/game-of-life-redux by deleted user 9 years ago
- Have to use css-loader 0.18.0 Because of: https://github.com/webpack/css-loader/issues/145 and https://github.com/nodesource/distributions/issues/73 so that the build works also in va vmware Jenkins — committed to Opetushallitus/soresu-form by deleted user 8 years ago
- Have to use css-loader 0.18.0 Because of: https://github.com/webpack/css-loader/issues/145 and https://github.com/nodesource/distributions/issues/73 so that the build works also in va vmware Jenkins — committed to Opetushallitus/valtionavustus by deleted user 8 years ago
- Proper configuration of webpack Modify output directory to build, use ExtractTextPlugin's latest example of consumption of css files. Polyfill is not needed for the css-loader, because we are not th... — committed to A3P/VRPrototyping by marclave 7 years ago
- Proper configuration of webpack Modify output directory to build, use ExtractTextPlugin's latest example of consumption of css files. Polyfill is not needed for the css-loader, because we are not th... — committed to A3P/VRPrototyping by marclave 7 years ago
@Strate I got it to work by downgrading css-loader to “^0.18.0”
@fhurta Same for me.
npm install es6-promise --save
and then addedrequire('es6-promise').polyfill()
at the top ofwebpack.config.js
.Had the same problem. Realized I had Node v0.10.26 (gosh!) installed. Upgraded to latest stable version (v4.2.1) and the problem was fixed.
I fixed problem by switching to node version 0.12.7 I guess 0.19.0 uses a dependency that breaks on node 0.10?
It’s a bit frustrating as my older projects can’t use 0.12 so I’ll have to switch back to 0.10 when I switch projects.
The same problem here, with node 6.2.1 css-loader 0.23.1
Workaround suggested by @andre-gh
works for me too
if you already have
bluebird
.Upgrading to node 0.12.x works too, in case you can’t make the leap to 4.