第一个视频我就出错了。

来源:2-1 vue-loader+webpack项目配置

慕丝cww

2021-07-13 22:22

 ./src/index.js + 1 modules 224 KiB [built] [code generated]

  ./src/app.vue 39 bytes [not cacheable] [built] [code generated] [1 error]


WARNING in configuration

The 'mode' option has not been set, webpack will fallback to 'production' for this value.

Set 'mode' option to 'development' or 'production' to enable defaults for each environment.

You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/


ERROR in ./src/app.vue

Module build failed (from ./node_modules/vue-loader/dist/index.js):      

Error: vue-loader requires @vue/compiler-sfc to be present in the dependency tree.

    at Object.<anonymous> (D:\WebKU\VuehomeKU\Vue_loaderText\node_modules\vue-loader\dist\index.js:8:11)

----------------------------------------------------------------------------

我也用了其他的方法,都还是报这个错。


写回答 关注

2回答

  • 灿灿大王
    2022-08-02 17:00:19

    vue-loader 15以上的版本要下载依赖@vue/compiler-sfc

  • 慕梦前来
    2022-02-17 18:18:03

    你这个vue-loader没有下好吧,或者npm下的版本不一致有兼容问题

Vue+Webpack打造todo应用

用前端最热门框架Vue+最火打包工具Webpack打造todo应用

84606 学习 · 787 问题

查看课程

相似问题