Throws error about multiple root elements in template. (Vue 3 + TypeScript)
See original GitHub issueInfo
- Platform: Ubuntu 20.04 (WSL2 and Ubuntu 20.04)
- Vetur version: 0.27.3
- VS Code version: 1.49.1
Problem
When adding multiple root template elements within a SFC (.vue
file), Vetur throws an error, even though Vue 3 now supports it, see screenshot below:
Reproducible Case
NOTE: Repo is used for another issue in this project as well.
- Clone the repo: https://github.com/dannysmc95/vetur-issue1,
- Install dependencies, using
npm install
, - Navigate to the
./src/App.vue
file in VSCode and see the issue,
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Vue 3 The template root requires exactly one element. ...
I ended up turning off Vetur linting. Vetur thinks that it is a Vue 2 project becuase it is in a VS Code...
Read more >Vue template should have a single root element
vue extension, Vue throws a compile error. For uncompiled templates, Vue only renders the first element as a root and outputs a warning...
Read more >Error: Multiple root nodes returned from render function. from v ...
It doesn't render any elements itself, it just renders the contents of its default slot. If that slot contains multiple items then they'll...
Read more >Can A Vue Template Have Multiple Root Nodes ...
You'll get a compilation and/or runtime error, as templates must have a single root element. Typically, you'll fix this problem by adding a ......
Read more >Components Basics
This is very similar to how we nest native HTML elements, but Vue implements its own component model that ... template <h1>Here are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
Sure, I have checked the issue, it seems to occur when multiple folders are included in the same workspace…?
There’s no multiroot support yet: https://github.com/vuejs/vetur/issues/424