question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Throws error about multiple root elements in template. (Vue 3 + TypeScript)

See original GitHub issue
  • [ x ] I have searched through existing issues
  • [ x ] I have read through docs
  • [ x ] I have read FAQ

Info

  • 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:

Screenshot

Reproducible Case

NOTE: Repo is used for another issue in this project as well.

  1. Clone the repo: https://github.com/dannysmc95/vetur-issue1,
  2. Install dependencies, using npm install,
  3. Navigate to the ./src/App.vue file in VSCode and see the issue,

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
dannysmc95commented, Sep 21, 2020

Sure, I have checked the issue, it seems to occur when multiple folders are included in the same workspace…?

3reactions
octrefcommented, Sep 21, 2020

There’s no multiroot support yet: https://github.com/vuejs/vetur/issues/424

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found