Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

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

Description

@TomppaPackage

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions