-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
fix: remove Nuxt context conflict #723
fix: remove Nuxt context conflict #723
Conversation
π· Deploy request for nuxt-storybook pending review.Visit the deploys page to approve it
|
ee127fb
to
b7634fd
Compare
@obulat Do you have a temporary solution to this problem? |
No, unfortunately I don't. |
Awesome! On a first glance it looks good to me, will do a bit more testing in a few days and then merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, each story in my code had its own Nuxt instance because each story functioned as a separate Vue app mounted in the Storybook canvas. I used the first Nuxt instance as a shared context with the Nuxt app project configuration. However, with recent changes to the package structure, I'm wondering about how it was working previously without this fix. Additionally, these changes have affected my ability to test it before merging or releasing. @tobiasdiez should we start writing tests ?
b7634fd
to
0be9f1e
Compare
That's still the case. But nuxt has now initial support for multi-app projects, so the global context didn't seem to be necessary anymore. @obulat what exactly is the need for the global context now? Do you know if
is by design or may be a nuxt bug? |
From my research
By default, it is taken from Is it possible to set the Nuxt options' |
@obulat Thanks a lot for the investigation. Yesterday, I've created two PRs on the nuxt repo that should implement your findings: nuxt/nuxt#28391 and nuxt/nuxt#28392. In the meantime we go with your solution, as it is clearly an improvement. I still get context issues in the "docs" section of the storybook, when multiple controls are displayed there. But single stories are working fine. |
Thank you for all your work investigating and opening new upstream PRs, @tobiasdiez ! |
π Linked issue
Related #661
β Type of change
π Description
This PR updates the global nuxt context, setting its
nuxt
property to the story's nuxt when setting up the current story.Previously, when navigating from one story to another story, Nuxt would get the context using the app's
_name
, which is the same for all stories, instead of using theglobalName
, which is different for each story.