温柔两刀
温柔两刀
  • 发布:2022-01-14 22:52
  • 更新:2022-01-15 13:09
  • 阅读:1217

cli建的Vue2工程,Sass Loader编译错误。

分类:HBuilder

在cli下编译错误,用HBuilderX编译也一样。
相关版本为:

"sass": "^1.32.8",
"sass-loader": "10.1.1",

error in ./src/pages/index/index.vue?vue&type=style&index=0&id=57280228&lang=scss&scoped=true&

Syntax Error: ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.

  • options has an unknown property 'additionalData'. These properties are valid:
    object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter?, nvue? }

    @ ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue-style-loader??ref--9-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/sty
    lePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--9-oneOf-1-2!./node_modules/postcss-loader/src??ref--9-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader
    /dist/cjs.js??ref--9-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--9-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_module
    s/@dcloudio/vue-cli-plugin-uni/packages/webpack-scoped-loader!./src/pages/index/index.vue?vue&type=style&index=0&id=57280228&lang=scss&scoped=true& 4:14-852 14:3-18:5 15:22-860
    @ ./src/pages/index/index.vue?vue&type=style&index=0&id=57280228&lang=scss&scoped=true&
    @ ./src/pages/index/index.vue
    @ ./src/pages.json
    @ ./src/main.js
    @ multi (webpack)-dev-server/client?http://192.168.31.243:8081/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

2022-01-14 22:52 负责人:无 分享
已邀请:
DCloud_UNI_FXY

DCloud_UNI_FXY

可以先移除package.json中的sass-loader

  • 7***@qq.com

    这个报错好久了,一直不敢升级用的老编译器版本。

    2022-01-17 11:23

温柔两刀

温柔两刀 (作者)

感谢,折腾了一天,终于搞定了。把sass-loader删除就行了。
我另一个uni-app cli建的TypeScript的Vue2工程,编译就没有问题。我对着package.json,把所有npm的版本都搞成一样也编译不通过,正准备把新工程改造成TypeScript呢。一比一比刻难道还有问题!幸亏官方及时出手。

该问题目前已经被锁定, 无法添加新回复