Vue-cli: vue-loader 11.2.0 升级后编译出错

Created on 22 Mar 2017  ·  5Comments  ·  Source: vuejs/vue-cli

重现方法:

vue-cli 2.8.1 中 执行

vue init webpack test
附加的库都不需要选,

ERROR Failed to compile with 2 errors 17:58:30

error in ./src/App.vue

Syntax Error: Unexpected token {

@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"id":"data-v-53c6d8e7","scoped":false,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 4:14-303 13:3-17:5 14:22-311
@ ./src/App.vue
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js

Most helpful comment

简单测试分析:

package.json 中 11.1.4 以上版本,默认安装的是 11.2.0 【注:昨天才发布】

"vue-loader": "^11.1.4"

把 11.1.4 前的 ^ 符号 移除,则正常运行。

All 5 comments

简单测试分析:

package.json 中 11.1.4 以上版本,默认安装的是 11.2.0 【注:昨天才发布】

"vue-loader": "^11.1.4"

把 11.1.4 前的 ^ 符号 移除,则正常运行。

Hello!
Please, open the issue on the relevant template repo (webpack one) and provide some steps to reproduce the problem.
Thanks!

error:
client?56e5:45 ./~/css-loader?sourceMap!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-ca1675bc","scoped":true,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/view/menuList.vue
Module not found: Error: Can't resolve './css/manager.css' in 'E:\fanqielaile\src\view'
@ ./~/css-loader?sourceMap!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-ca1675bc","scoped":true,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/view/menuList.vue 3:10-89
@ ./~/vue-style-loader!./~/css-loader?sourceMap!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-ca1675bc","scoped":true,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/view/menuList.vue
@ ./src/view/menuList.vue
@ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
@ ./src/App.vue
@ ./src/main.js

I have the same problem

err

 Uncaught SyntaxError: missing ) after argument list

error source code

 if(!content.locals) {
   module.hot.accept("!!../../../node_modules/css-loader/index.js?sourceMap!../../../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-698d67f8\",\"scoped\":false,\"hasInlineConfig\":false}!../../../node_modules/sass-loader/lib/loader.js!../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./list.vue", function() {
     var newContent = require("!!../../../node_modules/css-loader/index.js",/"scoped/":false,/"hasInlineConfig/":false}!../../../node_modules/sass-loader/lib/loader.js!../../../node_modules/vue-loader/lib/selector);
     if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
     update(newContent);
   });
 }

original code

<style lang="sass">
.box {}
</style>

Change to

<style lang="scss">
</style>

The difference between sass and scss https://segmentfault.com/q/1010000005346260

Was this page helpful?
0 / 5 - 0 ratings