-
-
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]: pnpm
+ vite
Mono-Repository Test Rig — Cases of No JSDocs, No new file HMR, Recursion, Breaking
#21399
Comments
…ook not properly processing JSDocs of out of root / symlinked components. Tracking issue: storybookjs/storybook#21399
ts
+ vite
+ storybook@7.0.0-beta.61
ts
+ vite
+ storybook@7.0.0-beta.62
Updated Reproduction to Edit:Please see inbound issue links below for consecutive version updates |
ts
+ vite
+ storybook@7.0.0-beta.62
ts
+ vite
+ storybook@7.0.0-beta.63
…xt upgrade --prerelease` storybookjs/storybook#21399 Console: ```bash .../Library/pnpm/store/v3/tmp/dlx-63741 | +603 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .../Library/pnpm/store/v3/tmp/dlx-63741 | Progress: resolved 624, reused 583, downloaded 20, added 603, done The integrity of 1080 files was checked. This might have caused installation to take longer. • Checking for latest versions of '@storybook/*' packagesinfo ,Using pnpm info Upgrading /Users/worker/development/reproduction-storybook-symlinks-pnpm/tools/package.json info info @storybook/addon-essentials ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/addon-interactions ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/addon-links ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/blocks ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/react ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/react-vite ^7.0.0-beta.62 → ^7.0.0-beta.63 info storybook ^7.0.0-beta.62 → ^7.0.0-beta.63 info info Run pnpm install to install new versions. info , info info ,Using pnpm info Upgrading /Users/worker/development/reproduction-storybook-symlinks-pnpm/tools/package.json info info No dependencies. info , • Installing upgrades • Preparing to install dependencies. ✓ ╭──────────────────────────────────────────────────────────────────╮ │ │ │ Update available! 7.28.0 → 7.29.1. │ │ Changelog: https://github.com/pnpm/pnpm/releases/tag/v7.29.1 │ │ Run "pnpm add -g pnpm" to update. │ │ │ │ Follow @pnpmjs for updates: https://twitter.com/pnpmjs │ │ │ ╰──────────────────────────────────────────────────────────────────╯ Packages: +44 -44 ++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------- Progress: resolved 830, reused 781, downloaded 28, added 44, done devDependencies: - @storybook/addon-essentials 7.0.0-beta.62 + @storybook/addon-essentials 7.0.0-beta.63 - @storybook/addon-interactions 7.0.0-beta.62 + @storybook/addon-interactions 7.0.0-beta.63 - @storybook/addon-links 7.0.0-beta.62 + @storybook/addon-links 7.0.0-beta.63 - @storybook/blocks 7.0.0-beta.62 + @storybook/blocks 7.0.0-beta.63 - @storybook/react 7.0.0-beta.62 + @storybook/react 7.0.0-beta.63 - @storybook/react-vite 7.0.0-beta.62 + @storybook/react-vite 7.0.0-beta.63 - storybook 7.0.0-beta.62 + storybook 7.0.0-beta.63 The integrity of 1207 files was checked. This might have caused installation to take longer. Done in 8.1s . ✓ 🔎 checking possible migrations.. 🔎 found a 'github-flavored-markdown-mdx' migration: ╭ Automigration detected ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ In MDX1 you had the option of using GitHub flavored markdown. │ │ │ │ Storybook 7.0 uses MDX2 for compiling MDX, and thus no longer supports GFM out of the box. │ │ Because of this you need to explicitly add the GFM plugin in the addon-docs options: │ │ https://storybook.js.org/docs/7.0/react/writing-docs/mdx#lack-of-github-flavored-markdown-gfm │ │ │ │ We recommend you follow the guide on the link above, however we can add a temporary storybook addon that helps make this migration easier. │ │ We'll install the addon and add it to your storybook config. │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ✔ Do you want to run the 'github-flavored-markdown-mdx' migration on your project? … no ╭ Migration check ran successfully ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ │ │ Skipped migrations: │ │ │ │ github-flavored-markdown-mdx │ │ │ │ ───────────────────────────────────────────────── │ │ │ │ If you'd like to run the migrations again, you can do so by running 'npx storybook@next automigrate' │ │ │ │ The automigrations try to migrate common patterns in your project, but might not contain everything needed to migrate to the latest version of Storybook. │ │ │ │ Please check the changelog and migration guide for manual migrations and more information: https://storybook.js.org/migration-guides/7.0 │ │ And reach out on Discord if you need help: https://discord.gg/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 ```
ts
+ vite
+ storybook@7.0.0-beta.63
ts
+ vite
+ ^storybook@7.0.0-beta.63
…xt upgrade --prerelease` storybookjs/storybook#21399 Console: ```bash .../Library/pnpm/store/v3/tmp/dlx-63741 | +603 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .../Library/pnpm/store/v3/tmp/dlx-63741 | Progress: resolved 624, reused 583, downloaded 20, added 603, done The integrity of 1080 files was checked. This might have caused installation to take longer. • Checking for latest versions of '@storybook/*' packagesinfo ,Using pnpm info Upgrading /Users/worker/development/reproduction-storybook-symlinks-pnpm/tools/package.json info info @storybook/addon-essentials ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/addon-interactions ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/addon-links ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/blocks ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/react ^7.0.0-beta.62 → ^7.0.0-beta.63 info @storybook/react-vite ^7.0.0-beta.62 → ^7.0.0-beta.63 info storybook ^7.0.0-beta.62 → ^7.0.0-beta.63 info info Run pnpm install to install new versions. info , info info ,Using pnpm info Upgrading /Users/worker/development/reproduction-storybook-symlinks-pnpm/tools/package.json info info No dependencies. info , • Installing upgrades • Preparing to install dependencies. ✓ ╭──────────────────────────────────────────────────────────────────╮ │ │ │ Update available! 7.28.0 → 7.29.1. │ │ Changelog: https://github.com/pnpm/pnpm/releases/tag/v7.29.1 │ │ Run "pnpm add -g pnpm" to update. │ │ │ │ Follow @pnpmjs for updates: https://twitter.com/pnpmjs │ │ │ ╰──────────────────────────────────────────────────────────────────╯ Packages: +44 -44 ++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------- Progress: resolved 830, reused 781, downloaded 28, added 44, done devDependencies: - @storybook/addon-essentials 7.0.0-beta.62 + @storybook/addon-essentials 7.0.0-beta.63 - @storybook/addon-interactions 7.0.0-beta.62 + @storybook/addon-interactions 7.0.0-beta.63 - @storybook/addon-links 7.0.0-beta.62 + @storybook/addon-links 7.0.0-beta.63 - @storybook/blocks 7.0.0-beta.62 + @storybook/blocks 7.0.0-beta.63 - @storybook/react 7.0.0-beta.62 + @storybook/react 7.0.0-beta.63 - @storybook/react-vite 7.0.0-beta.62 + @storybook/react-vite 7.0.0-beta.63 - storybook 7.0.0-beta.62 + storybook 7.0.0-beta.63 The integrity of 1207 files was checked. This might have caused installation to take longer. Done in 8.1s . ✓ 🔎 checking possible migrations.. 🔎 found a 'github-flavored-markdown-mdx' migration: ╭ Automigration detected ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ In MDX1 you had the option of using GitHub flavored markdown. │ │ │ │ Storybook 7.0 uses MDX2 for compiling MDX, and thus no longer supports GFM out of the box. │ │ Because of this you need to explicitly add the GFM plugin in the addon-docs options: │ │ https://storybook.js.org/docs/7.0/react/writing-docs/mdx#lack-of-github-flavored-markdown-gfm │ │ │ │ We recommend you follow the guide on the link above, however we can add a temporary storybook addon that helps make this migration easier. │ │ We'll install the addon and add it to your storybook config. │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ✔ Do you want to run the 'github-flavored-markdown-mdx' migration on your project? … no ╭ Migration check ran successfully ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ │ │ Skipped migrations: │ │ │ │ github-flavored-markdown-mdx │ │ │ │ ───────────────────────────────────────────────── │ │ │ │ If you'd like to run the migrations again, you can do so by running 'npx storybook@next automigrate' │ │ │ │ The automigrations try to migrate common patterns in your project, but might not contain everything needed to migrate to the latest version of Storybook. │ │ │ │ Please check the changelog and migration guide for manual migrations and more information: https://storybook.js.org/migration-guides/7.0 │ │ And reach out on Discord if you need help: https://discord.gg/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 ```
…upgrade --prerelease --skip-check`, fixes `rc.0` doctrine regression storybookjs/storybook#21399 FIXES storybookjs/storybook#21523 FIXES storybookjs/storybook#21527 Console: ```bash ➜ tools git:(master) ✗ pnpx storybook@next upgrade --prerelease --skip-check .../Library/pnpm/store/v3/tmp/dlx-97337 | +603 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .../Library/pnpm/store/v3/tmp/dlx-97337 | Progress: resolved 624, reused 581, downloaded 22, added 603, done • Checking for latest versions of '@storybook/*' packagesinfo ,Using pnpm info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json info info @storybook/addon-essentials ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/addon-interactions ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/addon-links ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/blocks ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/react ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/react-vite ^7.0.0-beta.63 → ^7.0.0-rc.1 info storybook ^7.0.0-beta.63 → ^7.0.0-rc.1 info info Run pnpm install to install new versions. info , info info ,Using pnpm info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json info info No dependencies. info , • Installing upgrades • Preparing to install dependencies. ✓ Packages: +809 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Packages are hard linked from the content-addressable store to the virtual store. Content-addressable store is at: /Users/worker/Library/pnpm/store/v3 Virtual store is at: node_modules/.pnpm Progress: resolved 830, reused 781, downloaded 28, added 809, done dependencies: + react 18.2.0 + react-dom 18.2.0 devDependencies: + @storybook/addon-essentials 7.0.0-rc.1 + @storybook/addon-interactions 7.0.0-rc.1 + @storybook/addon-links 7.0.0-rc.1 + @storybook/blocks 7.0.0-rc.1 + @storybook/react 7.0.0-rc.1 + @storybook/react-vite 7.0.0-rc.1 + @storybook/testing-library 0.0.14-next.1 + @types/react 18.0.28 + @types/react-dom 18.0.11 + prop-types 15.8.1 + storybook 7.0.0-rc.1 + typescript 4.9.5 + vite 4.1.4 The integrity of 1217 files was checked. This might have caused installation to take longer. Done in 16.2s . ✓ 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 ➜ tools git:(master) ✗ pnpm run storybook > tools@ storybook /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools > storybook dev -p 6006 @storybook/cli v7.0.0-rc.1 info => Starting manager.. WARN No story files found for the specified pattern: stories/**/*.mdx ╭──────────────────────────────────────────────────────╮ │ │ │ Storybook 7.0.0-rc.1 for react-vite started │ │ 127 ms for manager and 1.79 s for preview │ │ │ │ Local: http://localhost:6006/ │ │ On your network: http://192.168.178.102:6006/ │ │ │ ╰──────────────────────────────────────────────────────╯ ```
ts
+ vite
+ ^storybook@7.0.0-beta.63
ts
+ vite
+ ^storybook@7.0.0-rc.1
…upgrade --prerelease --skip-check`, fixes `rc.0` doctrine regression storybookjs/storybook#21399 FIXES storybookjs/storybook#21523 FIXES storybookjs/storybook#21527 Console: ```bash ➜ tools git:(master) ✗ pnpx storybook@next upgrade --prerelease --skip-check .../Library/pnpm/store/v3/tmp/dlx-97337 | +603 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .../Library/pnpm/store/v3/tmp/dlx-97337 | Progress: resolved 624, reused 581, downloaded 22, added 603, done • Checking for latest versions of '@storybook/*' packagesinfo ,Using pnpm info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json info info @storybook/addon-essentials ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/addon-interactions ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/addon-links ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/blocks ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/react ^7.0.0-beta.63 → ^7.0.0-rc.1 info @storybook/react-vite ^7.0.0-beta.63 → ^7.0.0-rc.1 info storybook ^7.0.0-beta.63 → ^7.0.0-rc.1 info info Run pnpm install to install new versions. info , info info ,Using pnpm info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json info info No dependencies. info , • Installing upgrades • Preparing to install dependencies. ✓ Packages: +809 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Packages are hard linked from the content-addressable store to the virtual store. Content-addressable store is at: /Users/worker/Library/pnpm/store/v3 Virtual store is at: node_modules/.pnpm Progress: resolved 830, reused 781, downloaded 28, added 809, done dependencies: + react 18.2.0 + react-dom 18.2.0 devDependencies: + @storybook/addon-essentials 7.0.0-rc.1 + @storybook/addon-interactions 7.0.0-rc.1 + @storybook/addon-links 7.0.0-rc.1 + @storybook/blocks 7.0.0-rc.1 + @storybook/react 7.0.0-rc.1 + @storybook/react-vite 7.0.0-rc.1 + @storybook/testing-library 0.0.14-next.1 + @types/react 18.0.28 + @types/react-dom 18.0.11 + prop-types 15.8.1 + storybook 7.0.0-rc.1 + typescript 4.9.5 + vite 4.1.4 The integrity of 1217 files was checked. This might have caused installation to take longer. Done in 16.2s . ✓ 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 ➜ tools git:(master) ✗ pnpm run storybook > tools@ storybook /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools > storybook dev -p 6006 @storybook/cli v7.0.0-rc.1 info => Starting manager.. WARN No story files found for the specified pattern: stories/**/*.mdx ╭──────────────────────────────────────────────────────╮ │ │ │ Storybook 7.0.0-rc.1 for react-vite started │ │ 127 ms for manager and 1.79 s for preview │ │ │ │ Local: http://localhost:6006/ │ │ On your network: http://192.168.178.102:6006/ │ │ │ ╰──────────────────────────────────────────────────────╯ ```
I'm not 100% sure about Vite but my best guess is the plugin you mentioned isn't configured to run on files outside of the CWD. @D1no -- you could experiment with setting options on the plugin in a |
@tmeasday yeah since the Vite configuration is coming from storybook dependencies, and the reproduction simply creates a Vite based storybook set-up: Manually overwriting / tinkering with how storybook instruments the bundler would be a hack - but not proper functionality. |
I get it, I am just interested in what the source of the problem @D1no |
@tmeasday I sadly don't understand enough about vite 😕 (which is actually the benefit, that you don't need to). I have the gut feeling that this has something to do with this dependency @joshwooding/vite-plugin-react-docgen-typescript by @joshwooding |
Edit: Created Issue @tmeasday I've just tried to update the reproduction from
➜ tools git:(master) ✗ pnpm run storybook
> tools@ storybook /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools
> storybook dev -p 6006
@storybook/cli v7.0.0-rc.3
ERR! Error: Cannot find module '@storybook/builder-vite'
ERR! Require stack:
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/dist/generate.js
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/bin/index.js
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/storybook@7.0.0-rc.3/node_modules/storybook/index.js
ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
ERR! at Function.resolve (node:internal/modules/cjs/helpers:116:19)
ERR! at getPreviewBuilder (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js:10:1789)
ERR! at buildDevStandalone (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js:40:2022)
ERR! at async withTelemetry (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js:27:3469)
ERR! at async dev (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/dist/generate.js:446:400)
ERR! at async Command.<anonymous> (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/dist/generate.js:448:327)
ERR! Error: Cannot find module '@storybook/builder-vite'
ERR! Require stack:
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/dist/generate.js
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/bin/index.js
ERR! - /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/storybook@7.0.0-rc.3/node_modules/storybook/index.js
ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
ERR! at Function.resolve (node:internal/modules/cjs/helpers:116:19)
ERR! at getPreviewBuilder (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js:10:1789)
ERR! at buildDevStandalone (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js:40:2022)
ERR! at async withTelemetry (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js:27:3469)
ERR! at async dev (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/dist/generate.js:446:400)
ERR! at async Command.<anonymous> (/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/dist/generate.js:448:327) {
ERR! code: 'MODULE_NOT_FOUND',
ERR! requireStack: [
ERR! '/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+core-server@7.0.0-rc.3/node_modules/@storybook/core-server/dist/index.js',
ERR! '/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/dist/generate.js',
ERR! '/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/@storybook+cli@7.0.0-rc.3/node_modules/@storybook/cli/bin/index.js',
ERR! '/Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/node_modules/.pnpm/storybook@7.0.0-rc.3/node_modules/storybook/index.js'
ERR! ]
ERR! }
WARN Broken build, fix the error above.
WARN You may need to refresh the browser.
✔ Would you like to help improve Storybook by sending anonymous crash reports? … yes
ELIFECYCLE Command failed with exit code 1. |
…upgrade --prerelease --skip-check` storybookjs/storybook#21399
We need to do a better job documenting this, obviously, but there is a setting that you can use to control which files are included for processing by react-docgen-typescript: //.storybook/main.ts
export default {
//... rest of config
typescript: {
reactDocgenTypescriptOptions: {
include: ['**/**.tsx', '../ui/**/**.tsx'],
},
},
} This doesn't fix the symlinks. Normally I would suggest setting https://vitejs.dev/config/shared-options.html#resolve-preservesymlinks to true, but that causes other things to break in your repo, likely because of pnpm. |
@jonniebigodes have you thought about having a section of the docs dedicated to monorepos and the things that need to be done in some situations to get things like the above working? |
ts
+ vite
+ ^storybook@7.0.0-rc.1
pnpm
+ vite
Mono-Repository Test Rig — Cases of No JSDocs, No new file HMR, Recursion, Breaking
@IanVS I have extended the ticket to a test rig. I hope that helps. |
@IanVS to answer your question, yes, I've considered it, but before committing to it I wanted to collect some information beforehand from our community sources (e.g., here in the issue tracker, and Discord) and see what are the major pain points and how to address them to avoid having the information scattered all around. If you could assist me with this, I'd be thankful for it. We could probably collaborate on it after the 7.0 launch. What do you think? Sounds like a reasonable plan? |
…as no standard problems output, therefore hacked via manual regex. #5 storybookjs/storybook#21399
…de --skip-check` Issue: storybookjs/storybook#21399
Can you try out the following canary in your project and let me know whether it resolves any of your issues (or generates new ones)? We're looking to switch the default docgen from Note that the change is currently only for Vite projects. Instructions in the "how to test" section: 👉 #23825 |
Haha thanks you @IanVS my god I'm looking for this since a long time |
Edit 2023-03-18: Consolidated the scope of this ticket to issue cases. See the original at the end.
Describe the bug
The following provides a list of issue cases of using
storybook
withpnpm
andvite
. To do so, I have looked at a number of closed source small to mid scale integrated mono-repository architectures to highlight storybook functionality issues as with as minimal content as possible. I hope this test rig helps you to achieve a "just work 🤺" state within larger projects, as it would help me to integrate storybook / chromatic into such.In this first version I've only concentrated on sourcing and rendering of stories files. In the future, building, interactions like testing and reporting should probably also be checked. As well as automated via playwright and github actions.
Storybook Version:
^7.0.0-rc.4
PNPM Version:
^7.29.3
Node Version:
18 LTS
Builder:
vite
Renderer:
react 18
Test Rig: Storybook in a Typical PNPM Monorepo
This repository mimics a typical integrated monorepo architecture where individual views or "micro front-ends" consume one or more centralized UI libraries. Build and test tooling (like storybook) live outside of that relationship to ensure weak coupling.
How to run Storybook Issues Inspection
Clone D1no/reproduction-storybook-symlinks-pnpm
and install
then for the case run the respective pnpm script...
Expectation
After running
pnpx storybook@next init --builder vite
, official storybook features should function without any additional configuration of loaders, builders or other down stream dependencies installed by storybook.Case 1: Components inside storybook folder
Components that are inside of the storybook root folder (
../stories
) will:tools/stories/Component
)another.stories-hmr.tsx
to.stories.tsx
)tools/stories/ComponentAsSymlink
)another.stories-hmr.tsx
to.stories.tsx
)Case 2-1: Components outside storybook folder
Components that are outside of the storybook root folder but referenced with a relative path (
../../ui/
) will:another.stories-hmr.tsx
to.stories.tsx
)Case 2-2: Single capitalized component folder outside storybook
A single component that is outside of the storybook root folder but referenced with a relative path (
../../ui/Component
) to its capitalized folder, will:❌ ERROR: WARN 🚨 Unable to index ./../ui/Component/index.stories.tsx
another.stories-hmr.tsx
to.stories.tsx
)Case 3: Components added to storybook from
pnpm
workspaceComponents that are outside of the storybook root folder but referenced via
pnpm
workspaces, therefore located in../node_modules/@repo/
as a symlink will:❌ ERROR: importers[path] is not a function
another.stories-hmr.tsx
to.stories.tsx
)Case 4: Components via
pnpm
with globby workaround inmain.ts
to avoidnode_modules
recursionpnpm run storybook:case_4 # or pnpm run storybook
Components that are outside of the storybook root folder but referenced via
pnpm
workspaces, ingested via a negative glob to avoid recursion as../node_modules/@repo/**!(node_modules)/**!(node_modules)/*.stories.@(js|jsx|ts|tsx)
will:another.stories-hmr.tsx
to.stories.tsx
)System
Via
pnpx sb@next info
on 2023-03-18Original Issue
Show
Describe the bug
Spend a couple hours trying to get storybooks typescript JSDoc to storybook ArgDocs working, but to no avail. As typical with MonoRepos, the UI library sits outside of the testing / build toolchain.
Components render, but there is no ArgDocs generation...
"../../"
in.storybook/main.ts
or
node_modules/*lib*/**/*stories*
) — but symlinks anywhere wont work for docgen (see reproduction)This means docgen doesn't work here:
To Reproduce
You find a reproduction as the following git repo:
https://github.com/D1no/reproduction-storybook-symlinks-pnpm
The same component is included as (1) local copy inside
stories/
, (2) as reference in.storybook/main.ts
and as a (3) symbolic link intostories/
.✅ All three types render successfully in storybook.
❌ Only variant (1) has JSDoc converted to story docs (!)
Exact same component and story, but as you see = different location = no JSDocGen.
The Component
index.tsx
The Component Story
index.stories.tsx
System
Additional context
I have the feeling, the problem lies in @joshwooding/vite-plugin-react-docgen-typescript 👀 ping @joshwooding
I really love storybook and have mad respect of what you guys are dealing with. For me, to get storybook into more larger projects, it would be important to have reliable mono repository functionality. In the past I recall from engineers issues with SB, be it with nx (or here, pnpm), that some features seem to always not quite work... Not sure what the SB test suit is, but it would be nice to know that common mono repo tools (pnpm worspaces, nx, turborepo, lerna, etc) are — in a basic set-up — in your test suit for features and add-ons. As single root projects seem to be a thing of the past (which is a great thing for test driven development and team scalability). Anyway: Tip to the hat; I hope this repro is helpful!
The text was updated successfully, but these errors were encountered: