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]: Failed to resolve import of "storybookpreview.jsx" #19824

Closed
kamil3777 opened this issue Nov 14, 2022 · 2 comments
Closed

[Bug]: Failed to resolve import of "storybookpreview.jsx" #19824

kamil3777 opened this issue Nov 14, 2022 · 2 comments

Comments

@kamil3777
Copy link

kamil3777 commented Nov 14, 2022

Describe the bug

Hello

I'm using storybook version alpha49 with vite plugin. When running storybook dev command storybook dev, I get following runtime error:
[vite] Internal server error: Failed to resolve import "C:pathtorepo.storybookpreview.jsx" from "..\..\virtual:\@storybook\builder-vite\vite-app.js". Does the file exist?
Plugin: vite:import-analysis
File: /virtual:/@storybook/builder-vite/vite-app.js:16:8
14 | import('@storybook/addon-essentials/highlight/preview'),
15 | import('@storybook/addon-interactions/preview'),
import('C:\path\to\repo\.storybook\preview.jsx')])
| ^
17 | return composeConfigs(configs);
18 | }

Works fine on alpha.48

Please let me know if you need any more information or need help with reproducing


@storybook/cli v7.0.0-alpha.49

To Reproduce

No response

System

Environment Info:

  System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-11300H @ 3.10GHz
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (107.0.1418.26)
  npmPackages:
    @storybook/addon-essentials: ^7.0.0-alpha.49 => 7.0.0-alpha.49 
    @storybook/addon-interactions: ^7.0.0-alpha.49 => 7.0.0-alpha.49 
    @storybook/addon-links: ^7.0.0-alpha.49 => 7.0.0-alpha.49 
    @storybook/react: ^7.0.0-alpha.49 => 7.0.0-alpha.49 
    @storybook/react-vite: ^7.0.0-alpha.49 => 7.0.0-alpha.49 
    @storybook/testing-library: ^0.0.13 => 0.0.13

Additional context

No response

@Dschungelabenteuer
Copy link
Member

Dschungelabenteuer commented Nov 14, 2022

@IanVS this might be related to #19689, this seems to be a Windows-specific issue, which is why it didn't raise any error when I've tested it. Just went through a quick test on both environments, it still works fine on Linux.

EDIT: Shouldn't this line use Vite's normalizePaths function?

EDIT2: This should be fixed by #19822

@shilman
Copy link
Member

shilman commented Nov 17, 2022

Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-alpha.50 containing PR #19822 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.

@shilman shilman closed this as completed Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants