[Bug]: Storybook builders use imports incorrectly #31558
Labels
bug
builder-vite
builder-webpack5
internal-qa
This issue was reported by the Storybook team, potentially on unreleased or prerelease software.
needs triage
Describe the bug
This is a subtle issue, but it could hit anyone using multiple Storybooks in a monorepo with differing versions.
Storybook's virtual entry files created by both builder-webpack5 and builder-vite do a direct import of
storybook
(webpack, vite).That virtual file is executed at the project root, and not at the location of the builder's node module. This means the import will resolve to
node_modules/storybook
which is not at all guaranteed to be the right version of the Storybook you're running.Those virtual entry files should be updated to take the resolved path to the
storybook
package as input.This might not be the only place this sort of thing happens, so we should take a deeper look into it.
Reproduction link
Reproduction steps
No response
System
Additional context
No response
The text was updated successfully, but these errors were encountered: