-
-
Notifications
You must be signed in to change notification settings - Fork 192
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: nuxt vue vite plugin registration fail (fix #590) #643
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
✅ Deploy Preview for histoire-examples-svelte3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for histoire-examples-vue3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for histoire-site ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for histoire-controls ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@Akryum @hugoattal would either of you have some time to review this change? Thank you very much in advance! |
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.
LGTM 👍 I tested the hook changes and everything is back to normal in my project.
Description
This PR aims to resolve issue #590. This issue appears to be related to mismatching of versions of vite and potentially related to vue plugin versions too.
The code block that has been removed here sought to patch in the expected Vite Vue plugins with a view to allowing customisation of the vue plugins by Histoire. However there doesn't seem to be any custom configurations applied and as this is causing issues on current versions of Nuxt and going back to previous versions it seems to be present I believe this is worthy of resolving here.
Changing the hook being used here to configResolved means we get the full nuxt config including these two plugins that are included by nuxt in between the two hooks used here. See the following code block https://github.com/nuxt/nuxt/blob/38b6d88cfab3477edabfa37d6f97b95eefc6ae6c/packages/vite/src/client.ts#L142-L149
The issue appears to be that global components are transformed twice. I was unable to find where in the nuxt config this may have been coming from so we could replicate in histoire but surely it would be better to just leave the nuxt vite config as is until there is a requirement to customise the settings on these two plugins?
Additional context
Here is a simple repro of the issue with Nuxt nightly. https://stackblitz.com/edit/github-gmhnpy?file=package.json
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).