Svelte: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?
See original GitHub issueDescribe the bug Fresh Svelte/Vite project initiated with Routify 3. JS/X method of declaring decorators are broken, so I attempted to use svelte syntax for stories instead as a workaround.
Using FooBar.stories.svelte
format results in error Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?
To Reproduce
$ npx @roxi/routify@next create MyApp
$ npm i
$ npx sb init
- Yes to v7 migration
- Write a basic component with a svelte native story
$ npm run storybook
Error: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?
System
System:
OS: Linux 5.15 Zorin OS 16.1
CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
Browsers:
Firefox: 104.0
npmPackages:
@storybook/addon-actions: ^6.5.12 => 6.5.12
@storybook/addon-essentials: ^6.5.12 => 6.5.12
@storybook/addon-interactions: ^6.5.12 => 6.5.12
@storybook/addon-links: ^6.5.12 => 6.5.12
@storybook/builder-vite: ^0.2.2 => 0.2.2
@storybook/svelte: ^6.5.12 => 6.5.12
@storybook/testing-library: ^0.0.13 => 0.0.13
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Adjacent JSX elements must be wrapped in an enclosing tag
The React.js error "Adjacent JSX elements must be wrapped in an enclosing tag" occurs when a component returns multiple elements. To solve the...
Read more >Adjacent JSX elements must be wrapped in an enclosing tag ...
If you do not want to add extra div to wrap around and want to return more than one child components you can...
Read more >How to Fix 'JSX element must be wrapped in enclosing tag'
Learn what is the root cause and how to fix 'Adjacent JSX elements must be wrapped in an enclosing tag' errors in your...
Read more >Adjacent JSX elements must be wrapped in an enclosing tag
The reason for the error is that when we use the render method it can only take a single HTML element. That means...
Read more >Issuehunt
Svelte : Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? #19217. doolijb posted onGitHub....
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 Free
Top 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
Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-alpha.35 containing PR #19339 that references this issue. Upgrade today to the
@next
NPM tag to try it out!Closing this issue. Please re-open if you think there’s still more to do.
Oh weird, is csf bundled in now? Regardless, installing and declaring it in
main.cjs
gives the same result.