Replies: 3 comments 1 reply
-
I also have this issue. |
Beta Was this translation helpful? Give feedback.
-
I've done a little digging and the issue seems to arise because on The import is relying on a module alias setup in main.ts here storybook/code/.storybook/main.ts Line 145 in 38bd824 And that alias is not working. This fits with me finding our module aliases were being overridden as well, I'm pretty sure this is due to the framework "helping" by auto setting aliases based on tsconfig.json and not merging those but instead overriding them. I've not yet proven this to be the case but will see if I can. |
Beta Was this translation helpful? Give feedback.
-
Ok a bit more digging and the solve to get past this is to include the vitest plugin as described And this issue about documenting it on the storybook site storybookjs/vite-plugin-storybook-nextjs#47 // vitest.config.ts
import { defineConfig } from "vite";
import { storybookNextJsPlugin } from '@storybook/nextjs-vite/vite-plugin'
export default defineConfig({
plugins: [storybookNextJsPlugin()],
}); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm in the process of replacing all
@storybook/react
imports with@storybook/nextjs-vite
following this guide here: https://storybook.js.org/docs/get-started/frameworks/nextjs#with-viteMy current unit tests are ran with Vitest, and use
composeStories()
from@storybook/react
and run without issue. By following the guide to use a framework-specific library and therefore swapping the import to@storybook/nextjs-vite
, I get a strange error:I have no idea where the
sb-original/image-context
is supposed to come from.Additional information
The
main.ts
file looks like this:Storybook version nis 9.0.9 (latest at the time of writing).
The unit test file is also rather straightforward:
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions