components icon indicating copy to clipboard operation
components copied to clipboard

[v2] broken functional components with multiple root

Open lancetharper opened this issue 3 years ago • 1 comments

Describe the bug Functional components that render multiple root modules no longer work

To Reproduce CodeSandbox

Steps to reproduce the behavior:

Component functional-a renders a single element (and is imported automatically).

Component functional-b throws an error about multiple root elements when imported automatically. If you uncomment the manual import and manually include the component in pages/index.vue it works correctly.

Expected behavior Functional components can render multiple roots

Additional context Discovered when I updated from nuxt 2.14.12 to 2.15.4

lancetharper avatar Apr 06 '21 20:04 lancetharper

I just folked and played around with the demo.

This bug can be avoided by setting components.loader: true.

CodeSandbox

Please note that there are some limitations or trade-off of lower performance in development mode, according to the authors.

nozomuikuta avatar May 19 '21 15:05 nozomuikuta