storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.61k stars 9.31k forks source link

[Bug]: Vite errors on startup lead to confusing error #20242

Closed tmeasday closed 1 year ago

tmeasday commented 1 year ago

Describe the bug

A simple unmodified react-vite repro, erroring due to vite4:

yarn run v1.22.19
$ storybook dev -p 6006 --ci
@storybook/cli v7.0.0-beta.4

info => Starting manager..

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

WARN Force closed manager build
unable to close vite server
✔ Would you like to send crash reports to Storybook? … yes
TypeError: Cannot read properties of undefined (reading 'compilation')
    at Qn (/Users/tom/GitHub/tmeasday/space-before-import/node_modules/@storybook/cli/dist/generate.js:336:2531)
error Command failed with exit code 1.

To Reproduce

https://github.com/tmeasday/vite-startup-error

IanVS commented 1 year ago

We're still working on vite 4 support, but 7.0.0-beta.6 does not crash upon startup, in your reproduction.

tmeasday commented 1 year ago

Sure. This issue is really just about the error not being helpful rather than the crash itself @IanVS

shilman commented 1 year ago

Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.7 containing PR #20243 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.