-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: Docs Rendering does not recover from errors thrown in React #21440
Comments
Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.63 containing PR #21454 that references this issue. Upgrade today to the
|
Unfortunately, I'm still experiencing this issue using 7.0.6. Ever since I upgraded to v7 I constantly need to restart Storybook as it's not recovering after I make slight modifications to my components. I'm using it with React+Webpack, CSF 3. MDX:
|
@wintercounter are the errors in the |
@tmeasday I found out how to reproduce it, it's quite simple actually, just add a error.recovery.mov |
@tmeasday It's happening in docs. It's not consistent to reproduce it for me. Sometimes it doesn't do it for a longer period, sometimes on the first change. The error I get is exactly the same as OP (different from @yannbf's repro). It's an even bigger issue that many times it does this on error-free changes, like duplicating a simple Error with stack:
|
Here is the initial value for storybook/code/lib/preview-api/src/modules/preview-web/docs-context/DocsContext.ts Lines 134 to 147 in c10da37
It seems like in the |
@yannbf I guess that's a new issue that was never actually addressed by this PR or #22127 shall we open a new issue? Probably easy to fix by changing the storybook/code/ui/blocks/src/components/Story.tsx Lines 52 to 55 in cded4cd
|
@wintercounter Can you log what's actually in It seems very odd though, IIRC the code path is that the HMR triggers a recreation of the It's not when you make >1 change at the same time?
To be clear the error in the OP is a legitimate error, this issue was about SB not recovering from that error, if you made a mistake and passed the wrong thing to |
Maybe it is an interaction with React Refresh somehow. I wonder what component it is trying to re-render? What's also odd in your stack trace is:
It's rendering webpack's error overlay that causes the |
It's there above (3rd picture): #21440 (comment) It is not caused by Fast Refresh. I tried disabling it and still have the same problem. The issue I believe is that it was always expected that upon editing, Storybook gets the same module reference. I guess that's not the case and that's not handled. If you want I open a new issue, I just thought to keep/re-open this maybe as it's the same error message, but it's a new issue indeed. |
Sorry, I was hoping to see the value of
But it doesn't always happen, right? I mean it's never happened to me before :) |
Hmm, so storybook/code/lib/preview-api/src/modules/preview-web/render/MdxDocsRender.ts Lines 65 to 69 in 07145b6
@wintercounter I wonder if you can put a logpoint in this function to see what the storybook/code/lib/preview-api/src/modules/store/StoryStore.ts Lines 264 to 270 in 07145b6
We've had a user report an issue before where a docs entry somehow got turned into a story entry on HMR. I've no idea how that could happen but if that's happening here, I guess that'd lead to |
Describe the bug
If you get an error in your MDX that comes from React (e.g. invalid value passed to
useOf
), and you fix it on HMR, all you get is a white screen.To Reproduce
yarn start
Introduction.mdx
:You see an error:
Change to
<Story of={ButtonStories.Primary} />
You see a white screen, no error in console:
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: