升级webpack时报的错
来源:1-6 (如果您初学,建议您先跟着课程版本走,项目完成后再升级)补充Webpack4.29升级(2)
慕神0494925
2019-10-16
跟着视频执行完:npm install vue-loader@14.2.4 -D
再启动项目会报如下的错:
ERROR in ./client/layout/header.vue (./node_modules/css-loader/dist/cjs.js?{“sourceMap”:true,“localIdentName”:"[path]-[name]-[hash:base64:5]",“importLoaders”:1,“camelCase”:true,“modules”:true}!./node_modules/vue-loader/lib/style-compiler?{“optionsId”:“0”,“vue”:true,“scoped”:false,“sourceMap”:true}!./node_modules/stylus-loader!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./client/layout/header.vue)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
ValidationError: Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
- options has an unknown property ‘camelCase’. These properties are valid:
object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals? }
at validate (E:\programs\vue\pack\node_modules\css-loader\node_modules\schema-utils\dist\validate.js:50:11)
at Object.loader (E:\programs\vue\pack\node_modules\css-loader\dist\index.js:34:28)
@ ./client/layout/header.vue (./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader/dist/cjs.js?{“sourceMap”:true,“localIdentName”:"[path]-[name]-[hash:base64:5]",“importLoaders”:1,“camelCase”:true,“modules”:true}!./node_modules/vue-loader/lib/style-compiler?{“optionsId”:“0”,“vue”:true,“scoped”:false,“sourceMap”:true}!./node_modules/stylus-loader!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./client/layout/header.vue) 4:14-448 14:3-18:5 15:22-456
@ ./client/layout/header.vue
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./client/app.vue
@ ./client/app.vue
@ ./client/create-app.js
@ ./client/client-entry.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:8000 (webpack)/hot/dev-server.js ./client/client-entry.js
1回答
-
Jokcy
2019-10-20
css-loader也发了新版本,所以也需要更新配置了,你可以退回上个大版本,或者更新配置,配置可以看这里:https://github.com/webpack-contrib/css-loader
122019-11-23
相似问题
回答 2