Skip to content
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]: vite builder is incompatible with vite v6 #29565

Closed
leiit opened this issue Nov 7, 2024 · 3 comments
Closed

[Bug]: vite builder is incompatible with vite v6 #29565

leiit opened this issue Nov 7, 2024 · 3 comments

Comments

@leiit
Copy link

leiit commented Nov 7, 2024

Describe the bug

Attempting to build a storybook using builder-vite with latest Vite betas fails. Development environment works as expected.

To reproduce:

  1. pnpm dlx storybook@latest init
  2. Choose vite+react
  3. pnpm install -D vite@beta
  4. pnpm build-storybook

Results in:

> storybook build

@storybook/core v8.4.2

info => Cleaning outputDir: storybook-static
info => Loading presets
info => Building manager..
info => Manager built (139 ms)
info => Building preview..
info Using tsconfig paths for react-docgen
vite v6.0.0-beta.6 building for production...
✓ 0 modules transformed.
x Build failed in 24ms
=> Failed to build the preview
[vite:build-html] Could not load ./sb-preview/runtime.js: ENOENT: no such file or directory, open './sb-preview/runtime.js'
file: ./iframe.html
Error: Could not load ./sb-preview/runtime.js: ENOENT: no such file or directory, open './sb-preview/runtime.js'

Versions up to [email protected] worked fine. See their changelog for what changed between betas 5 & 6.

Reproduction link

https://github.com/leiit/sb-vite6

Reproduction steps

corepack enable
pnpm i
pnpm build-storybook

System

Storybook Environment Info:

  System:
    OS: macOS 15.0
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.asdf/installs/nodejs/22.11.0/bin/node
    npm: 10.9.0 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 8.15.8 - ~/.asdf/installs/nodejs/22.11.0/bin/pnpm <----- active
  Browsers:
    Chrome: 130.0.6723.116
    Safari: 18.0
  npmPackages:
    @storybook/addon-essentials: ^8.4.2 => 8.4.2 
    @storybook/addon-interactions: ^8.4.2 => 8.4.2 
    @storybook/addon-onboarding: ^8.4.2 => 8.4.2 
    @storybook/blocks: ^8.4.2 => 8.4.2 
    @storybook/react: ^8.4.2 => 8.4.2 
    @storybook/react-vite: ^8.4.2 => 8.4.2 
    @storybook/test: ^8.4.2 => 8.4.2 
    eslint-plugin-storybook: ^0.11.0 => 0.11.0 
    storybook: ^8.4.2 => 8.4.2 

Additional context

No response

@yannbf
Copy link
Member

yannbf commented Nov 8, 2024

Hey @leiit thank you so much for reporting this issue, investigating which version caused it and providing a repro! This is just perfect to help us get a fix sooner. We've contacted the Vite team and a fix is on the way.

@yannbf
Copy link
Member

yannbf commented Nov 8, 2024

This should be fixed in the upcoming release of Vite vitejs/vite#18618

@yannbf
Copy link
Member

yannbf commented Nov 12, 2024

I'll be closing this issue since it's not related to Storybook per se. The fix PR in Vite has been merged but not yet released, I assume it will happen soon!

@yannbf yannbf closed this as completed Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants