[Bug]: Incorrect Vitest Line Numbers with @storybook/experimental-nextjs-vite
#31081
Labels
Milestone
@storybook/experimental-nextjs-vite
#31081
Describe the bug
Description:
When using
@storybook/experimental-nextjs-vite
as the Storybook framework, Vitest reports incorrect code line numbers for errors in my tests. This makes debugging more difficult. I've confirmed that line numbers are reported accurately when using@storybook/react-vite
.Steps to Reproduce:
@storybook/experimental-nextjs-vite
.Button.stories.ts
) that will fail. For example, try to find an element that doesn't exist.@storybook/react-vite
.Expected Behavior:
Vitest should report the correct line number where the error occurs in the story file, regardless of whether
@storybook/experimental-nextjs-vite
or@storybook/react-vite
is used.Current Behavior:
When using
@storybook/experimental-nextjs-vite
, Vitest reports an incorrect line number for the error.Screenshots/Code Examples:
Correct Line Numbers (using @storybook/react-vite):
Incorrect Line Numbers (using @storybook/experimental-nextjs-vite):
Reproduction link
https://github.com/kenfdev/storybook-vitest
Reproduction steps
The test should show the error I've explained above. This project was built with Vite + React and I added
@storybook/experimental-nextjs-vite
andnextjs
manually. But I've confirmed this same phenomenon occurs in a real nextjs project, too.System
Additional context
No response
The text was updated successfully, but these errors were encountered: