storybook: [Bug]: Storybook hangs/doesn't finish building 8.4.6/8.4.7
Describe the bug
We’re using Storybook (with React) in version 8.4.5. I noticed that our Renovate update failed for 8.4.6 and now 8.4.7 as well. I didn’t create a bug ticket so far, because I cannot reproduce it locally and only see it in our CI (Gitlab).
I decided to create a ticket now as I was checking if someone else has the same problem, but I couldn’t find something related. Maybe it helps someone else to jump into the discussion (and ideally a solution later). (https://github.com/storybookjs/storybook/issues/29715 seems to about a different issue.)
Reproduction link
#sorry-😦
Reproduction steps
No response
System
Storybook in the mentioned versions, Gitlab CI and $ node -v v22.11.0.
Additional context
The last output I get after running $ storybook build--output-dir storybook is this:
Generate File to /builds/xxx/yyy/storybook/meta.json info => Preview built (1.33 min) info => Output directory: /builds/xxx/yyy/storybook attention => Storybook now collects completely anonymous telemetry regarding usage. This information is used to shape Storybook’s roadmap and prioritize features. You can learn more, including how to opt-out if you’d not like to participate in this anonymous program, by visiting the following URL: https://storybook.js.org/telemetry
Afterwards my CI job runs into a timeout. As far as
I tried to get more information by using different log levels and --debug, but I couldn’t get more information. I will try to debug more and if I find a solution/workaround I will update (and close) this issue.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 26
- Comments: 16 (6 by maintainers)
Commits related to this issue
- Chore(demo): Switch from `react-docgen-typescript` to `react-docgen` * with new Storybook versions the preview and the build were not able to run * `error TS5083: Cannot read file './tsconfig.jso... — committed to lmc-eu/spirit-design-system by literat 2 years ago
- Chore(demo): Switch from `react-docgen-typescript` to `react-docgen` * with new Storybook versions the preview and the build were not able to run * `error TS5083: Cannot read file './tsconfig.jso... — committed to lmc-eu/spirit-design-system by literat 2 years ago
- Chore(demo): Switch from `react-docgen-typescript` to `react-docgen` * with new Storybook versions the preview and the build were not able to run * `error TS5083: Cannot read file './tsconfig.jso... — committed to lmc-eu/spirit-design-system by literat 2 years ago
I’ve updated the library to opt-in to the watch behaviour, this way users will have the old (broken) behaviour by default which should solve the performance issues.
Since this might come up for someone else in our project this issue ended up causing JavaScript heap out of memory error, probably due to the size of many JSON files and general size of the project.
This problem was NOT fixable by switching over from
react-docgen-typescripttoreact-docgen(this caused the hanging issue instead). Also 0.3.0 override did not help either way.However 0.5.0 did fix the issue:
The time I spent figuring out this issue is not reflected by the length of this message.
Hey everyone! I’m assuming this might be related to an internal change in typescript docgen (as I noticed most of you have it from your main.js, thanks for sharing!). The new version parses your typescript config to find what to process, instead of glob which was being used before. Sharing your tsconfig files would be useful as well.
Could you please do either of this and share back whether you still have issues in CI. Mind you I’m not asking you to do this as a final solution, just as an experiment to assist us finding whether this is the real cause of the issue:
Use react-docgen instead of react-docgen-typescript
Downgrade typescript docgen by using package overrides in your package.json
Yarn:
NPM:
PNPM:
Thank you so much Josh!! Here’s a PR to upgrade the version https://github.com/storybookjs/storybook/pull/30422
I’ve noticed that version 0.4.0 of
@joshwooding/vite-plugin-react-docgen-typescriptworks without issues, while version 0.4.1 causes the build to break. The problem seems linked to this commit: 12793a6.Additionally, while switching from
react-docgen-typescripttoreact-docgenhelps with the hanging build issue, it disrupts the controls addon functionality.This issue still persists with Storybook 8.5.0.
hey @yannbf thanks for your suggestions. Using
react-docgeninstead ofreact-docgen-typescriptwas enough for us. With no need to downgrade the docgen.Just adding a comment here to say this is also happening in our app. Haven’t had time to debug further.
System:
Here is the
main.ts:I’m having the same issue
here is my main.ts
This is all working with 8.4.5 for me with 8.4.7 just hanging in my pipeline