Compiling error when the template of the .vue file has the attribute lang="html"
See original GitHub issueVersion
15.2.6
Reproduction link
https://github.com/eltonchan/test_vue_loader
Steps to reproduce
1、use vue cli3 create application (vue cli3 default use 15 version for vue-loader) 2、add html-loader to webpapck Configuration
chainWebpack: (config) => {
config.module
.rule('html')
.test(/\.html$/)
.use('html-loader')
.loader('html-loader')
.end();
},
3、.vue file template add lang=“html” attribute
<template lang="html">
4、npm run serve
What is expected?
compiling success
What is actually happening?
error in ./src/App.vue?vue&type=template&id=7ba5bd90&lang=html&
Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js): (Emitted value instead of an instance of Error) Error compiling template:
By the way, in 14 version No such problem。
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Error compiling template/ Error in mounted hook
First problem - template should contain exactly one root element. that ... handling in vue - https://v2.vuejs.org/v2/guide/events.html.
Read more >Template Syntax | Vue.js
Under the hood, Vue compiles the templates into highly-optimized JavaScript code. ... The v-html attribute you're seeing is called a directive.
Read more >Hide div outside of template in .vue file - Laracasts
I have and div outside my template that i want to hide during edit. this works: Copy Code <template lang="html"> <div v-show="create">create</div>.
Read more >HTML page has lang attribute | ACT Rule | WAI - W3C
This rule checks that an HTML page has a non-empty lang attribute. ... methods than the lang attribute, for example using HTTP headers...
Read more >App Internationalization (i18n) - Quasar Framework
The recommended package for handling website/app is vue-i18n . ... On the Boot File documentation page you can see a specific example for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Modify your package.json file to have
"vue-loader": "<15.0.0"
in therequire
section. Then runnpm install
This proves problematic for a component that uses a language other than html. For example, we use pug for all of our vue component files.
I’m getting the same error, but also can see a message beneath the template:
When I nest the entire component in a div, the compiler gives me the same error for another component, then another, then another…
It seems as though, in my case at least, the loader doesn’t recognize
v-toolbar-items(...)
as a root element.