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 Failed to Resolve Import during Runtime #586

Open
1 task
TomppaPackage opened this issue Oct 4, 2023 · 2 comments
Open
1 task

[Bug] Vite Failed to Resolve Import during Runtime #586

TomppaPackage opened this issue Oct 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@TomppaPackage
Copy link

What version of vite are you using?

4.4.9

System info and storybook versions

System:
OS: Windows 10 10.0.22621
CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
Binaries:
Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD <----- active
Browsers:
Edge: Spartan (44.22621.2283.0), Chromium (117.0.2045.47)

Describe the Bug

When running Storybook via storybook dev, the application compiles and is hosted as expected.

However, when opening the browser, the Application crashes with the following error;

[vite] Internal server error: Failed to resolve import "D:WorkProjectsStorybook" from "..\..'..\virtual:\@storybook\builder-vite\vite./app.js"

The correct path should be `D:\Work Projects\StoryBook', though it appears to not parse the path correctly on Windows.

This works on an M1/M2 Mac.

Dependencies;

    "@storybook/addon-actions": "^7.3.2",
    "@storybook/addon-essentials": "^7.3.2",
    "@storybook/addon-interactions": "^7.3.2",
    "@storybook/addon-links": "^7.3.2",
    "@storybook/addon-mdx-gfm": "^7.3.2",
    "@storybook/react": "^7.3.2",
    "@storybook/react-vite": "^7.3.2",
    "@storybook/testing-library": "0.2.0",
    "@vitejs/plugin-react-swc": "^3.3.2",
    "storybook": "^7.3.2",
    "vite": "^4.4.9",
    "vite-plugin-dts": "^2.3.0"

Link to Minimal Reproducible Example

No response

Participation

  • I am willing to submit a pull request for this issue.
@TomppaPackage TomppaPackage added the bug Something isn't working label Oct 4, 2023
@IanVS
Copy link
Member

IanVS commented Oct 4, 2023

Hm, I haven't heard of windows problems for a while. Would you mind updating to the latest versions, and potentially clear and regenerate your lock file in case you have an old version of a storybook package hanging around?

@TomppaPackage
Copy link
Author

@IanVS
Same error I'm afraid, after running npx storybook@latest upgrade with a deleted lockfile.
With a clean NPM cache for good measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants