Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs addon freezes with certain nested JSX expressions in dev server #16730

Open
jpveooys opened this issue Nov 19, 2021 · 7 comments
Open

Docs addon freezes with certain nested JSX expressions in dev server #16730

jpveooys opened this issue Nov 19, 2021 · 7 comments

Comments

@jpveooys
Copy link

Describe the bug

When:

  • there are certain nested JSX expression within a React Story
  • dynamic code generation for the docs addon is enabled (the default)
  • the Storybook dev server is used

Visiting the docs page for that story causes the browser to freeze.

To Reproduce

I've pushed a repro here with instructions: https://github.com/jpveooys/storybook-bug-repro

The story that triggers the problem is here:

https://github.com/jpveooys/storybook-bug-repro/blob/5cee67290512bc467f9d06e412799c1505653924/stories/Header.stories.tsx#L21-L27

System

10:34 $ npx sb@next info

Environment Info:

  System:
    OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
    CPU: (16) x64 AMD Ryzen 7 PRO 5850U with Radeon Graphics
  Binaries:
    Node: 16.13.0 - /usr/bin/node
    Yarn: 3.1.0 - /usr/bin/yarn
    npm: 8.1.0 - /usr/bin/npm
  Browsers:
    Chrome: 96.0.4664.45
    Firefox: 94.0
  npmPackages:
    @storybook/addon-actions: ^6.4.0-rc.4 => 6.4.0-rc.4 
    @storybook/addon-docs: ^6.4.0-rc.4 => 6.4.0-rc.4 
    @storybook/addon-essentials: ^6.4.0-rc.4 => 6.4.0-rc.4 
    @storybook/addon-links: ^6.4.0-rc.4 => 6.4.0-rc.4 
    @storybook/react: ^6.4.0-rc.4 => 6.4.0-rc.4 

Additional context

This problem doesn't happen in a production build.

It also doesn't happen if the story is rewritten to use the args pattern.

jpveooys added a commit to Royal-Navy/design-system that referenced this issue Nov 22, 2021
This enables dynamic source code generation in Storybook on the Docs tab.

Note the following limitations:

- a couple of stories were being hit by storybookjs/storybook#16730, they've been amended to work around that
- it also breaks IE11 on Chromatic, so it's disabled there too
@pustovalov
Copy link

pustovalov commented Dec 5, 2021

Got same issue

Versions: 6.3.12, 6.4.7

Reproduce:
https://github.com/pustovalov/sb-freeze-react-repro
https://github.com/pustovalov/sb-freeze-react-repro/blob/master/stories/Page.stories.tsx#L22

Profile (need to kill tab process, to even get profile results)
image
image

Can share this profile, if it helps

UPD. Removing storybook-readme helped in my case

@stale
Copy link

stale bot commented Jan 9, 2022

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jan 9, 2022
@dcolin
Copy link

dcolin commented Jan 10, 2022

Hi, i've got the same issue on Storybook version 6.4.10.

Any idea?

@stale stale bot removed the inactive label Jan 10, 2022
@Tdolphus1
Copy link

Got the same issue on 6.4.19

@luuk777w
Copy link

luuk777w commented Aug 9, 2022

Same issue on v6.5.10

@kompolom
Copy link

kompolom commented Sep 5, 2022

Here is a workaround Royal-Navy/design-system#2813 (comment)

@jasosims
Copy link

This is still happening in Storybook 7.1.1. For me, disabling source generation doesn't help — Storybook completely freezes my browser tab immediately, and it doesn't even matter which story I'm viewing. The only solution I could find is to move the props to the args for the story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants