Vue使用中常见错误总结

1. This dependency was not found:

项目启动时遇到以下错误:

This dependency was not found:
!!vue-style-loader!css-loader?{“minimize”:false,“sourceMap”:false}!../…/node_modules/vue-loader/lib/style-compiler/index?{“vue”:true,“id”:“data-v-1d57e5ea”,“scoped”:false,“hasInlineConfig”:false}!stylus-loader?{“sourceMap”:false}!../…/node_modules/vue-loader/lib/selector?type=styles&index=0!./a.vue
in ./src/components/a.vue

To install it, you can run: npm install --save
!!vue-style-loader!css-loader?{“minimize”:false,“sourceMap”:false}!../…/node_modules/vue-loader/lib/style-compiler/index?{“vue”:true,“id”:“data-v-1d57e5ea”,“scoped”:false,“hasInlineConfig”:false}!stylus-loader?{“sourceMap”:false}!../…/node_modules/vue-loader/lib/selector?type=styles&index=0!./a.vu

解决方案
项目中使用了css扩展语言sass,缺少相关的依赖包,运行:
npm install sass-loader --save
npm install node-sass --save

2. Duplicate keys detected

浏览器Console下报错:

[Vue warn]: Duplicate keys detected: ‘产品部’. This may cause an update
error.

解决方案
使用v-for时,没有用主键作为key



你可能感兴趣的:(异常收集,Vue,前端)