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]: Issues With Vitest Default Config #29570

Open
mindingdata opened this issue Nov 8, 2024 · 0 comments
Open

[Bug]: Issues With Vitest Default Config #29570

mindingdata opened this issue Nov 8, 2024 · 0 comments

Comments

@mindingdata
Copy link

Describe the bug

When I create a new project, with nothing in it, and install the Storybook Vitest plugin, it has an issue escaping characters.

Run npm create vite@latest to create a new React project, with Typescript
Run npx storybook@latest init to install Storybook over the top
Run npx storybook add @storybook/experimental-addon-test to install the new test runner
Edit your project.json to have a test command that runs "vitest" as per documentation

Run "npm run test".

You should see an error like so :

TypeError: Failed to fetch dynamically imported module: http://localhost:63315/@fs/C:/Projects/PlainStorybook/vite-project/.storybook%0Bitest.setup.ts?import&browserv=1731025020823

The %0B in the middle of that was interesting and is a null byte. So I searched "itest.setup" in my project and in the vitest.workspace.ts file that is created by default, it has that and a subtle escaping issue seems to be occurring :

Image

If I double backslash this, I can move past this error.

Reproduction link

http://defaultproject.com

Reproduction steps

No response

System

Storybook Environment Info:

System:
OS: Windows 10 10.0.19045
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1245U
Binaries:
Node: 20.10.0 - C:\Node\node-v20.10.0-win-x64\node.EXE
npm: 10.2.3 - C:\Node\node-v20.10.0-win-x64\npm.CMD <----- active
Browsers:
Edge: Chromium (128.0.2739.42)
npmPackages:
@storybook/addon-essentials: ^8.4.2 => 8.4.2
@storybook/addon-onboarding: ^8.4.2 => 8.4.2
@storybook/blocks: ^8.4.2 => 8.4.2
@storybook/experimental-addon-test: ^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

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

No branches or pull requests

2 participants