-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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]: 7.0.0-rc.-3
breaks vite + pnpm support - Error: Cannot find module @storybook/builder-vite
#21612
Comments
I met this issue too yesterday and digged a little. This is because the
Starting from One possible solution is react-vite put builder-vite in its peer dependencies, which means the user must install builder-vite as a direct dependency. One good thing is pnpm 8 will install peer dependencies by default so it's not that painful to tell the user to install a new package. Workarounds:
|
Thanks @hyrious — hopefully that helps the storybook team to fix this regression. Can't tell what PR broke this from rc.1 to rc.3. |
7.0.0-rc.-3
breaks vite support - Error: Cannot find module @storybook/builder-vite
7.0.0-rc.-3
breaks vite + pnpm support - Error: Cannot find module @storybook/builder-vite
I had this issue today as well with rc-1 on Vercel build but not locally. A bit strange but it was ok yesterday. |
Just ran a repo i didn't run for a week, and apparently this is broken even in older version — worked without problems last week and build from a lock file. Pretty frustrating when dependencies are changed without versioning. _tooling/storybook dev: @storybook/cli v7.0.0-beta.62
_tooling/storybook dev: ERR! Error: Cannot find module '@storybook/builder-vite'
_tooling/storybook dev: ERR! Require stack:
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/dist/generate.js
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/bin/index.js
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/storybook@7.0.0-beta.62/node_modules/storybook/index.js
_tooling/storybook dev: ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
_tooling/storybook dev: ERR! at Function.resolve (node:internal/modules/cjs/helpers:116:19)
_tooling/storybook dev: ERR! at getPreviewBuilder (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js:10:1789)
_tooling/storybook dev: ERR! at buildDevStandalone (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js:40:2022)
_tooling/storybook dev: ERR! at async withTelemetry (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js:27:3469)
_tooling/storybook dev: ERR! at async dev (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/dist/generate.js:446:400)
_tooling/storybook dev: ERR! at async Command.<anonymous> (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/dist/generate.js:448:327)
_tooling/storybook dev: ERR! Error: Cannot find module '@storybook/builder-vite'
_tooling/storybook dev: ERR! Require stack:
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/dist/generate.js
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/bin/index.js
_tooling/storybook dev: ERR! - /Users/worker/development/portfolio/platform/node_modules/.pnpm/storybook@7.0.0-beta.62/node_modules/storybook/index.js
_tooling/storybook dev: ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
_tooling/storybook dev: ERR! at Function.resolve (node:internal/modules/cjs/helpers:116:19)
_tooling/storybook dev: ERR! at getPreviewBuilder (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js:10:1789)
_tooling/storybook dev: ERR! at buildDevStandalone (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js:40:2022)
_tooling/storybook dev: ERR! at async withTelemetry (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js:27:3469)
_tooling/storybook dev: ERR! at async dev (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/dist/generate.js:446:400)
_tooling/storybook dev: ERR! at async Command.<anonymous> (/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/dist/generate.js:448:327) {
_tooling/storybook dev: ERR! code: 'MODULE_NOT_FOUND',
_tooling/storybook dev: ERR! requireStack: [
_tooling/storybook dev: ERR! '/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+core-server@7.0.0-beta.62/node_modules/@storybook/core-server/dist/index.js',
_tooling/storybook dev: ERR! '/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/dist/generate.js',
_tooling/storybook dev: ERR! '/Users/worker/development/portfolio/platform/node_modules/.pnpm/@storybook+cli@7.0.0-beta.62/node_modules/@storybook/cli/bin/index.js',
_tooling/storybook dev: ERR! '/Users/worker/development/portfolio/platform/node_modules/.pnpm/storybook@7.0.0-beta.62/node_modules/storybook/index.js'
_tooling/storybook dev: ERR! ]
_tooling/storybook dev: ERR! }
_tooling/storybook dev: WARN Broken build, fix the error above.
_tooling/storybook dev: WARN You may need to refresh the browser.
_tooling/storybook dev: Failed
/Users/worker/development/portfolio/platform/_tooling/storybook:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL @tooling/storybook@ dev: `storybook dev -p 6006 --ci --quiet` Adding storybook git:(trunk) pnpm install @storybook/builder-vite
WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
WARN deprecated trim@0.0.1: Use String.prototype.trim() instead
WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
../.. | +377 -3 ++++++++++++++++++++++++++++++++++++++-
../.. | Progress: resolved 1364, reused 1322, downloaded 21, added 373, done
../../node_modules/.pnpm/core-js@3.29.1/node_modules/core-js: Running postinstall script, done in 40ms
../.. prepare$ cd .. && husky install platform/_tooling/.husky
│ husky - Git hooks installed
└─ Done in 322ms
dependencies:
+ @storybook/builder-vite 0.4.2
WARN Issues with peer dependencies found
_tooling/storybook
└─┬ @storybook/builder-vite 0.4.2
└─┬ @storybook/mdx1-csf 1.0.0-next.0
└─┬ @mdx-js/react 1.6.22
└── ✕ unmet peer react@"^16.13.1 || ^17.0.0": found 18.2.0
The integrity of 3590 files was checked. This might have caused installation to take longer.
Done in 6.1s Force updated the working project to |
…e and explicit addition of `@storybook/builder-vite` storybookjs/storybook#21612
I tested storybook in a new pnpm project with the following steps:
@D1no it looks like when you added I also followed your reproduction steps, and was able to successfully upgrade to rc.3 and start storybook without any issues. Perhaps you have a problem in your pnpm global cache? pnpm/pnpm#4413 (reply in thread) |
Hey, thanks for the quick reply @IanVS . Mh, I ran clean build 🧐. Was also surprised, that despite lock files and all an old project on
↳ This kinda evidences flaky versioning and is >impossible< to provide a reproduction for. So please remove the |
I don't understand what you mean by non-dertministic. If you are using lock files, which every major package manager supports, then nothing is non-deterministic. Maybe pnpm has a bug or something, which is not treating lockfiles correctly? |
Unlikely that a version 7 package manager, existing for many years, vetted by thousands of engineers has an issue with simple lock files. Much more likely is that your build chain is pushing changes that aren't versioned or not correctly peer referenced. I don't know your set-up but when people report stuff like this, i.e. "works on my machine but not on vercel" it points to build chain issues and not to the user. |
There's no possibility that we are pushing unversioned changes. Without some steps to reproduce the problem, I'm not sure there's anything that we can do to troubleshoot, which is the reason for the "needs reproduction" label. I suggested that perhaps there is an issue with your local pnpm global cache, and so far that's my only thought of what could be going wrong. I'm curious to hear from @ozguruysal as well, the details of their situation. Is the version of pnpm and node the same in Vercel as it is locally? Have you cleared all of your local caches?
Does that mean that builds were occurring correctly on Vercel yesterday, and today they are failing, without any changes being made to the project? If so, then my only thoughts are that there is an issue in the npm package registry or within the Vercel environment. |
Hey, I also started getting the error without changing any dependencies. All I did was pushing some code changes to the same branch which was deploying just fine a day ago. I have pnpm version 7.29.1 locally and I believe Vercel is autodetecting and using the same pnpm version looking at this log item (I'm not 100% sure though):
Correct. No dependency changes. Currently I'm using the workaround |
@zkochan have you ever heard of something like this? A few users here are saying that in the last few days, they got what appears to be changes to dependencies when installing a project with a |
@ozguruysal it would be good to confirm what version of pnpm is used by vercel, and whether that has maybe changed in the last few days if it's not locked. |
I don't know if it is related but there was a regression in pnpm v7.29.2, which was fixed in v7.29.3. There are now more paths added to NODE_PATH in the command shims generated by pnpm to fix this issue. |
Ah that does seem suspiciously similar, thanks @zkochan! I'm going to close out the issue, because it doesn't seem to be related to storybook, but let me know if anyone finds anything that does seem to point our direction. |
@IanVS that indeed sounds like a I'm thinking about writing an end-2-end "is-storybook-enterprise-ready" test suit that covers common mono repository pnpm use cases. Guess the "it just works" and "pnpm support without hoisting or workarounds" in the storybook 7 live stream still left me salty, as its not (yet) the case. |
Sorry, but what part is not the case? I was able to add storybook to a pnpm project just this morning without any issues, as I showed above. |
Well @IanVS, no JSDocs (https://github.com/D1no/reproduction-storybook-symlinks-pnpm), recursive inclusion of node_modules which can not be anti globbed (#11181 (comment)), some other issues I forgot about now |
If it works with pnpm v7.29.1 but doesn't work with v7.29.3 then please create an issue with a repository that reproduces the issue. |
Describe the bug
Regression when updating from
7.0.0-rc.1
to7.0.0-rc.3
leading toError: Cannot find module '@storybook/builder-vite'
To Reproduce
(I use
pnpm
)Clone Reproduction and Checkout 839aabc
Update Storybook with
Result:
System
Additional context
Originally posted by @D1no in #21399 (comment)
The text was updated successfully, but these errors were encountered: