Skip to content
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

Merged
merged 1 commit into from
Nov 30, 2023
Merged

fix: nuxt vue vite plugin registration fail (fix #590) #643

merged 1 commit into from
Nov 30, 2023

Conversation

GerryWilko
Copy link
Contributor

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?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • If it's a new feature, provide a convincing reason to add it. Ideally, you should open a suggestion issue first and have it approved before working on it.
  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Nov 28, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

codesandbox bot commented Nov 28, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

netlify bot commented Nov 28, 2023

Deploy Preview for histoire-examples-svelte3 ready!

Name Link
🔨 Latest commit e99d7ba
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/6565e8cc44ea9b0008c2a1a8
😎 Deploy Preview https://deploy-preview-643--histoire-examples-svelte3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 28, 2023

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit e99d7ba
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/6565e8cc0e7f81000854947b
😎 Deploy Preview https://deploy-preview-643--histoire-examples-vue3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 28, 2023

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit e99d7ba
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/6565e8cc46107500088fb4d4
😎 Deploy Preview https://deploy-preview-643--histoire-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 28, 2023

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit e99d7ba
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/6565e8cc75e9ab00081ceab0
😎 Deploy Preview https://deploy-preview-643--histoire-controls.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@GerryWilko
Copy link
Contributor Author

@Akryum @hugoattal would either of you have some time to review this change?

Thank you very much in advance!

Copy link

@hacknug hacknug left a 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.

@Akryum Akryum merged commit 47bb3e0 into histoire-dev:main Nov 30, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants