Module build failed: TypeError: this.getOptions is not a function at Object.lessLoader
dearweb 发布:2021-05-10 16:06:48阅读:在Vue-cli中使用lang="less"时报错:
Module build failed: TypeError: this.getOptions is not a function at Object.lessLoader (D:\study\VUE_study\mall-master\node_modules\less-loader\dist\index.js:21:24) @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-e7a41aa8","scoped":true,"hasInlineConfig":false}!./node_modules/less-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Login/index.vue 4:14-382 13:3-17:5 14:22-390 @ ./src/components/Login/index.vue @ ./src/router/index.js @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
出现这个问题的原因是less-loader版本过高,降级到5.0.0即可
npm install less-loader@5.0.0 --save-dev
小礼物走一波,支持作者
赏还没有人赞赏,支持一波吧