css-loader icon indicating copy to clipboard operation
css-loader copied to clipboard

Module build failed: ReferenceError: Promise is not defined

Open iroy2000 opened this issue 11 years ago • 34 comments

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.

iroy2000 avatar Sep 24 '15 21:09 iroy2000

Duplicate of https://github.com/webpack/css-loader/issues/144.

ben-eb avatar Sep 24 '15 21:09 ben-eb

same +1

dev-mraj avatar Oct 05 '15 15:10 dev-mraj

+1

Aknilam avatar Oct 06 '15 15:10 Aknilam

+1

nazywamsiepawel avatar Oct 13 '15 20:10 nazywamsiepawel

Is there any quick workaround?

Strate avatar Oct 14 '15 08:10 Strate

@Strate I got it to work by downgrading css-loader to "^0.18.0"

nazywamsiepawel avatar Oct 14 '15 08:10 nazywamsiepawel

+1

wouter-willems avatar Oct 15 '15 12:10 wouter-willems

+1, @nazywamsiepawel, same. Seems to be exclusive to 0.19.0

philihp avatar Oct 15 '15 19:10 philihp

+1 @nazywamsiepawel . Your workaround works.

changtimwu avatar Oct 16 '15 01:10 changtimwu

@nazywamsiepawel thnx, that did the trick

wouter-willems avatar Oct 16 '15 08:10 wouter-willems

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.

sean-stanley avatar Oct 19 '15 18:10 sean-stanley

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.

umarashfaq avatar Oct 23 '15 15:10 umarashfaq

Thanks @andre-gh .. Works !!

anilpai avatar Oct 29 '15 20:10 anilpai

I upgraded my node to v0.12.7 and it worked.

yangshun avatar Nov 08 '15 17:11 yangshun

@andre-gh thanks - the workaround works perfectly!

dr-nafanya avatar Nov 25 '15 19:11 dr-nafanya

@andre-gh thank you for saving my day

rish1690 avatar Nov 30 '15 03:11 rish1690

I'm getting this on node v5.3.0

jackgeek avatar Dec 18 '15 13:12 jackgeek

@andre-gh Thanks man!

Kobold avatar Dec 25 '15 15:12 Kobold

I got this problem on node: '0.10.40'. To upgrade node version to node: '4.2.4' , solve this problem.

keithsun80 avatar Dec 26 '15 14:12 keithsun80

Had the same problem. Realized I had Node v0.10.29 (gosh!) installed

yanhaijing avatar Dec 27 '15 14:12 yanhaijing