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.

Svelte: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
shilmancommented, Oct 5, 2022

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!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there’s still more to do.

1reaction
doolijbcommented, Sep 23, 2022

@doolijb You’ll need to install and use https://github.com/storybookjs/addon-svelte-csf in order to write svelte-native stories.

Oh weird, is csf bundled in now? Regardless, installing and declaring it in main.cjs gives the same result.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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