Possible bug in @storybook/addon-essentials version 8? #26583
-
I wanted to report something very puzzling, which could be a bug, or it could be just me. When I updated Storybook from v7 to v8, one of my stories stopped working, while the other stories were working fine. The error message complained that one of my components was not defined:
When I checked the component that Storybook was complaining of, I confirmed that it existed and was exported properly. The only noteworthy thing about that component was that it a default export that was then re-exported through a barrel index.ts file. Failing to find anything wrong with the component itself, I tried to tweak storybook config, which was as follows:
I suspected there was something wrong with babel; but first, I tried disabling I do not know what to attribute this to. I cannot imagine why addon-essentials would break component import; but perhaps to some of you this might ring a bell? Here's the output of storybook info:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @azangru Thank you for sharing your issue! I have a guess what the root cause might be, and I would like to ask you to try something out: Could you please reenable You can read about this in the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-docgen-component-analysis-by-default I want to try out, whether the error disappears if you use the former default export default {
+ typescript: {
+ reactDocgen: "react-docgen-typescript",
+ },
}; Please let me know whether this has helped! |
Beta Was this translation helpful? Give feedback.
Hi @azangru
Thank you for sharing your issue!
I have a guess what the root cause might be, and I would like to ask you to try something out:
Could you please reenable
@storybook/addon-essentials
and opt-out forreact-docgen-typescript
?In Storybook 8, we changed the default component analysis tool from
react-docgen-typescript
toreact-docgen
. We got a lot of reports that, in some edge cases, the analysis tool doesn't extract component information properly and even leads to breaking stories.You can read about this in the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-docgen-component-analysis-by-default
I want to try out, whether the error disappear…