vue
引入 scss
编译报错:
./node_modules/css-loader?{“sourceMap”:true}!./node_modules/vue-loader/lib/style-compiler?{“vue”:true,“id”:“data-v-1168d9a7”,“scoped”:true,“hasInlineConfig”:false}!./node_modules/sass-loader/dist/cjs.js?{“sourceMap”:true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/app_main.vue
Module build failed: TypeError: this.getResolve is not a function
at Object.loader (D:\WORK\VueProject\XiaoWei\node_modules\sass-loader\dist\index.js:52:26)
@ ./node_modules/vue-style-loader!./node_modules/css-loader?{“sourceMap”:true}!./node_modules/vue-loader/lib/style-compiler?{“vue”:true,“id”:“data-v-1168d9a7”,“scoped”:true,“hasInlineConfig”:false}!./node_modules/sass-loader/dist/cjs.js?{“sourceMap”:true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/app_main.vue 4:14-373 13:3-17:5 14:22-381
@ ./src/components/app_main.vue
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
问题原因:
sass-loader
版本过高,当前版本是 8.0.2
解决方法:
sass-loader
版本降为7.3.1
# 卸载当前版本
npm uninstall sass-loader
# 安装指定版本
npm install sass-loader@7.3.1 --save-dev
来源:CSDN
作者:邪人君子
链接:https://blog.csdn.net/qq_27127385/article/details/104377311