-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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]: @storybook/experimental-addon-test doesn't have access to the Nuxt instance when running in CLI #30418
Comments
Hi @pbilyk Thank you for opening the issue. Can you please provide a reproduction? |
@tobiasdiez Can you maybe take a quick look? |
I haven't yet had the chance to play with the storybook-vitest integration, but based on my stomach feeling I would say the problem is that one needs to initialize nuxt first in the vitest environment, see https://nuxt.com/docs/getting-started/testing. Perhaps this also requires additional changes in the nuxt storybook module (https://github.com/nuxt-modules/storybook). I don't have the capacity to work on this in the foreseeable future, but would be happy to review PRs. |
@valentinpalkovic Here is the reproduction repo https://github.com/pbilyk/nuxt-storybook-issues The test for image passes in the client but fails in the CLI and in the output you can see that the image is not rendered in the headless mode. This also includes another issue that I ran into recently, where when you make a change in a component you gat an error saying Should I make a new bug for this ro this is already tracked somewhere? |
I'm experiencing this issue too, I'm using Storybook in a Nuxt Layer with future.compatibilityVersion: 4 |
Hello @valentinpalkovic! Did you have a chance to check the reproduction I provided? And also the issue that I reported below? |
Unfortunately, I am not the Nuxt expert in the Storybook team. I am forwarding this to @kasperpeulen. |
@kasperpeulen sorry to bother you but did you have a chance to look at this issue? |
Describe the bug
I have a couple of stories that use and components, and they work fine, passing the component tests when run through the Storybook webapp.
However, when I run the tests through the CLI I get the
[Error: [nuxt] instance unavailable]
and the components that need Nuxt do not render at all resulting in failing tests.My config is:
main.ts:
vitest.setup.ts:
vitest.config.ts:
vitest.workspace.ts:
Reproduction link
http://example.com
Reproduction steps
No response
System
Additional context
No response
The text was updated successfully, but these errors were encountered: