LoginSignup
2
3

More than 3 years have passed since last update.

vue css-loader エラー:Module build failed: TypeError: this.getResolve is not a functionでコケる

Last updated at Posted at 2020-02-08

症状

ERROR in ./node_modules/css-loader?sourceMap!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-39e2d1f7","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/dist/cjs.js!./src/pages/About/About.scss
Module build failed: TypeError: this.getResolve is not a function
    at Object.loader (/Users/MyUserName/MyDirectory/node_modules/sass-loader/dist/index.js:52:26)
...
..
.

解決策

sass-loaderで似たようなエラーが出たとき、一旦uninstall(remove)して、古いバージョンをistall(add)してみると直った、という記事を見て、同じことをcss-loaderでも試したら直った。

npmの場合

$ npm uninstall css-loader
$ npm install css-loader@2.0.0

yarnの場合

$ yarn remove css-loader
$ yarn add css-loader@2.0.0

備考:css-loaderのverについて

npmのcss-loaderのページを見て適当に@2.0.0としたが、もうちょい新しいverでもいけるのかもしれないものの、試してない。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3