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]: Terminal Warning on fresh install #30480

Closed
theboyWhoCriedWoolf opened this issue Feb 6, 2025 · 23 comments · Fixed by #30511
Closed

[Bug]: Terminal Warning on fresh install #30480

theboyWhoCriedWoolf opened this issue Feb 6, 2025 · 23 comments · Fixed by #30511

Comments

@theboyWhoCriedWoolf
Copy link

Describe the bug

Running a fresh installation creates the following warning in the terminal. Is this expected? any way to rectify this?

15:39:38 [vite] (client) warning: Failed to resolve "\u0000/virtual:/@storybook/builder-vite/storybook-stories.js" from /virtual:/@storybook/builder-vite/vite-app.js. An id should be written. Did you pass a URL?
  Plugin: vite:import-analysis
  File: /virtual:/@storybook/builder-vite/vite-app.js:32:30
  30 |
  31 |      if (import.meta.hot) {
  32 |        import.meta.hot.accept('/virtual:/@storybook/builder-vite/storybook-stories.js', (newModule) => {
     |                               ^
  33 |        // importFn has changed so we need to patch the new one in
  34 |        window.__STORYBOOK_PREVIEW__.onStoriesChanged({ importFn: newModule.importFn });
^C%

Reproduction link

http://localhost:6006/

Reproduction steps

Install storybook with pnpm dlx storybook@latest init and select Vite + React. Run storybook and see the warning

System

Storybook Environment Info:

  System:
    OS: macOS 14.4.1
    CPU: (12) arm64 Apple M3 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    npm: 10.9.2 - ~/Library/Application Support/Herd/config/nvm/versions/node/v22.13.0/bin/npm
    pnpm: 10.2.0 - ~/Library/Caches/fnm_multishells/68997_1738805487661/bin/pnpm <----- active
  Browsers:
    Chrome: 132.0.6834.160
    Safari: 17.4.1
  npmPackages:
    @storybook/addon-essentials: ^8.5.3 => 8.5.3
    @storybook/addon-interactions: ^8.5.3 => 8.5.3
    @storybook/addon-mdx-gfm: ^8.5.3 => 8.5.3
    @storybook/addon-onboarding: ^8.5.3 => 8.5.3
    @storybook/blocks: ^8.5.3 => 8.5.3
    @storybook/experimental-nextjs-vite: ^8.5.3 => 8.5.3
    @storybook/react: ^8.5.3 => 8.5.3
    @storybook/react-vite: ^8.5.3 => 8.5.3
    @storybook/test: ^8.5.3 => 8.5.3
    eslint-plugin-storybook: ^0.11.2 => 0.11.2
    storybook: ^8.5.3 => 8.5.3

Additional context

No response

This comment has been minimized.

@shavonn
Copy link

shavonn commented Feb 6, 2025

I also get this in the terminal after upgrading to the .3 patch version. The above does not suppress it.

@lunchin
Copy link

lunchin commented Feb 6, 2025

I got it to go away by setting logLevel in vite.config.ts

@Joerdwa
Copy link

Joerdwa commented Feb 7, 2025

I noted that the issue occurs when vite is bumped to version 6.1.0. Using version 6.0.9 the warning is no longer present.

@Joerdwa
Copy link

Joerdwa commented Feb 7, 2025

I've had a bit of a dig through the CHANGELOG notes for Vite 6.1.0 and I think the warning was introduced as part of this PR: vitejs/vite#18840. Looks like resolving HMR Deps by URL is a fallback now and will be removed in Vite v7.

@SteveALee
Copy link

SteveALee commented Feb 7, 2025

I also got today after bumping...

vite -> 6.1.0
vitetest -> 3.0.4
@vitest/browser -> 3.0.5
@vitest/coverage-v8 -> 3.0.5

Everything seems to work as before.

@utkupadhyay
Copy link

Is there a proper solution to this warning ? I am on vite 6.0.9

@jdavis-software

This comment has been minimized.

@KrofDrakula

This comment has been minimized.

@jdavis-software

This comment has been minimized.

@jdavis-software

This comment has been minimized.

@KrofDrakula

This comment has been minimized.

@Joerdwa

This comment has been minimized.

@lukasjelonek
Copy link

I see the same problem with storybook + vite + vue. With vite 6.1.0 I get the warning. With vite 6.0.9 it works without the warning.

@pdfabbro
Copy link

This happens for me even on 6.0.9

@Joerdwa
Copy link

Joerdwa commented Feb 10, 2025

@pdfabbro I would double check your package.json to ensure its not pulling a newer dependency based on semver .You might have "vite":"^6.0.9" which would install 6.1.0 as it's in the semver range being a minor update.

@pdfabbro
Copy link

@Joerdwa good call, thanks for that! I didn't even realize that's how that worked.

@SteveALee
Copy link

If on vs code the "version lens" extension lets you see what's going on in package .json. use it all the time

@valentinpalkovic
Copy link
Contributor

Fix is on its way.

@rogerDesignDev
Copy link

I had to revert to version 5.4.14.

@github-project-automation github-project-automation bot moved this from Needs Discussion to Done in Core Team Projects Feb 11, 2025
@pdfabbro
Copy link

Fix is on its way.

Awesome! When can we expect a new version to be out?

@qw-in
Copy link

qw-in commented Feb 12, 2025

Awesome! When can we expect a new version to be out?

@pdfabbro looks like v8.5.4 already includes the fix (#30511)

@pdfabbro
Copy link

@qw-in ah sorry, I did check earlier but I was looking for a new version of vite, not storybook because my mind was on how it still worked with vite 6.0.9 but not vite 6.10.0. My bad. Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.