VUE报错You are using the runtime-only build of Vue where the template compiler is not available

报错信息

Failed to compile.

./src/views/home/login.vue
Module not found: Error: Can't resolve 'sass-loader'

解决方案

在vue项目下新建一个vue.config.js

文件内容为

module.exports = {
  //Solution For Issue:You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
  //zhengkai.blog.csdn.net
  runtimeCompiler: true
}

重启项目后问题解决

最后

所参考的原文献的地址为:
VUE报错You are using the runtime-only build of Vue where the template compiler is not available

posted @ 2021-01-28 21:10  DAmarkday  阅读(212)  评论(0编辑  收藏  举报