-
-
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
Storybook v6.5.9 dev server crashes when used with pnpm on a big monorepo #18907
Comments
I have exactly the same issue when creating a react project in NX (nx.dev) and giving it a storybook project. |
@smalljiaot so are you able to reproduce this on a brand new repo? It would be awesome if we could have a test repo, cause I believe it would speed up assessment for the Storybook team! 🙏 |
Updating to webpack 5 solves this issue with pnpm, but Storybook is now taking minutes to load, it's stuck regardless of how many stories I add. It eventually works, but it can take up to 5 mins, even just for 1 story. |
After debugging storybook locally, I found out the issue here. In fact, when listing all stories manually, no glob pattern, it works. I believe the fact that pnpm creates a nested node_modules tree is the problem here, as stories files will end up in the node_modules of a package importing another one from the same monorepo. In my case it was like this:
So with a simple Even when using yarn or npm, node_modules are not necessarily always hoisted, as if there are conflicts in resolution, specific versions would be installed locally for a package rather than hoisted. I'll open a new issue with these details... |
Thanks @LucaColonnello, you saved a lot of our time. |
Solved by #22873 |
Describe the bug
When using
pnpm
withStorybook
v6.5.9
, in alerna
monorepo with 80+ packages, runningpnpm start-storybook
results in a long compilation time (minutes) and then the dev server eventually crashes when the browser loads thestorybook
's localhost url.This is the error, it seems a memory leak occurs.
This does not happen in the same codebase using
yarn
v1.22.It also works perfectly fine with 20 something stories, still slow, but it works.
It never works if I add any
mdx
stories, regardless of the total of stories.I tried to get down to the issue debugging, and I'm wondering if this could be an issue with the watcher, as it doesn't happen in the prod build, which still takes minutes to compile, but it loads and works perfectly fine when opening the static output.
To Reproduce
So sorry I don't have a repo as this is internal and this is hard to reproduce; it only happens with this many components.
Totally appreciate if a repo with this issue is required, but I thought to ask before making that effort as I've seen this has been raised in the past #12348 , but none of the fixes suggested there worked.
I've been on this for weeks now, so I thought to reach out and see if there was any suggestion based on past experiences, hoping this might just be a config issue.
System
Additional context
pnpm-workspace.yaml
.npmrc
.storybook/main.js
The text was updated successfully, but these errors were encountered: