l***@qq.com
l***@qq.com
  • 发布:2020-09-03 19:17
  • 更新:2021-06-01 09:15
  • 阅读:1497

基于 @vue/cli在webstorm下运行报错,希望提高兼容性

分类:uni-app

npm run dev:h5

test@0.1.0 dev:h5 E:\workspace\BEREE\mobile-hospital\trunk\test\test
cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve

请注意运行模式下,因日志输出、sourcemap以及未压缩源码等原因,性能和包体积,均不及发行模式。
INFO Starting development server...

ERROR Failed to compile with 5 errors 18:34:00

error in ./src/pages/componentsB/readMore/index.vue?vue&type=style&index=0&id=5f0fdb0a&lang=scss&scoped=true&

Module build failed (from D:/Develop-tools/nodejs/node_global/node_modules/sass-loader/dist/cjs.js):
SassError: expected selector.

115 │ .wrap /deep/ .u-content{
│ ^

src\pages\componentsB\readMore\index.vue 115:7 root stylesheet

@ ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!D:/Develop-tools/nodejs/node_global/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-scoped-loader!./src/pages/componentsB/readMore/index.vue?vue&type=style&index=0&id=5f0fdb0a&lang=scss&scoped=true& 4:14-869 14:3-18:5 15:22-877
@ ./src/pages/componentsB/readMore/index.vue?vue&type=style&index=0&id=5f0fdb0a&lang=scss&scoped=true&
@ ./src/pages/componentsB/readMore/index.vue
@ ./src/pages.json
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.104:8081/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

error in ./src/pages/template/address/addSite.vue?vue&type=style&index=0&id=7fc6ec51&lang=scss&scoped=true&

Module build failed (from D:/Develop-tools/nodejs/node_global/node_modules/sass-loader/dist/cjs.js):
SassError: expected selector.

118 │ /deep/ .line{
│ ^

src\pages\template\address\addSite.vue 118:1 root stylesheet

@ ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!D:/Develop-tools/nodejs/node_global/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-scoped-loader!./src/pages/template/address/addSite.vue?vue&type=style&index=0&id=7fc6ec51&lang=scss&scoped=true& 4:14-871 14:3-18:5 15:22-879
@ ./src/pages/template/address/addSite.vue?vue&type=style&index=0&id=7fc6ec51&lang=scss&scoped=true&
@ ./src/pages/template/address/addSite.vue
@ ./src/pages.json
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.104:8081/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

2020-09-03 19:17 负责人:无 分享
已邀请:
AgoniNemo

AgoniNemo - XZC168520@163.com

遇到同样的问题 请问解决了吗

  • AgoniNemo

    解决方法就是把sass-loader版本改为7.0.0,然后安装node-sass

    2021-06-07 15:40

  • 睡不醒哎

    回复 AgoniNemo:

    2022-11-01 14:02

l***@qq.com

l***@qq.com (作者)

两种处理方式:

1、把 /deep/ 删掉
2、把 /deep/ 换成 ::deep

根据你的实际情况试着处理

  • k***@163.com

    你好,请问在哪里修改呀?我这边好像没用引用这个包,找不到这个文件的路径http://localhost:8081/static/js/sockjs.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

    2021-06-20 15:16

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