Error compiling template:
来源:11-2 构建工具-2

至心
2018-07-23
ERROR in ./app/js/home/index.vue?vue&type=template&id=4c3b6c1c&lang=html& (./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/html-loader!./node_modules/vue-loader/lib??vue-loader-options!./app/js/home/index.vue?vue&type=template&id=4c3b6c1c&lang=html&)
Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error)
Error compiling template:
module.exports = "\n<div class=\"home\">\n <h1>home</h1>\n</div>\n";
- text "module.exports = "\n" outside root element will be ignored.
@ ./app/js/home/index.vue?vue&type=template&id=4c3b6c1c&lang=html& 1:0-262 1:0-262
@ ./app/js/home/index.vue
@ ./app/js/router/index.js
@ ./app/js/main.js
@ multi (webpack)-dev-server/client?http://localhost:9000 ./app/js/main.js
ERROR in ./app/js/App.vue?vue&type=template&id=f3d8e912&lang=html& (./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/html-loader!./node_modules/vue-loader/lib??vue-loader-options!./app/js/App.vue?vue&type=template&id=f3d8e912&lang=html&)
Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error)
Error compiling template:
module.exports = "\n<div id=\"app\">\n <router-view></router-view>\n</div>\n";
- text "module.exports = "\n" outside root element will be ignored.
3回答
-
至心
提问者
2018-07-24
212018-11-01 -
至心
提问者
2018-07-24
折磨了我两天的问题....就是你这个...
按这个GitHub上面有个回答, 我试了讲`<template lang="html">`改成了`<template>`. 同时, 我自己根据报错信息将`<style></style>`内部的内容全部干掉.
结果倒是可以正确看到页面.
但是, <style>中不能放内容怎么破?
00 -
快乐动起来呀
2018-07-24
vue-loader按指定版本安装试试呢
012018-07-24
相似问题