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: deduplicate plugins #2391

Merged
merged 1 commit into from
Apr 24, 2024
Merged

fix: deduplicate plugins #2391

merged 1 commit into from
Apr 24, 2024

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Apr 23, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Noticed when trying out https://github.com/pi0/nitro-cloudflare-dev/blob/main/src/index.ts that multiple copies of the same plugin were injected; this caused the following error:

[nitro 14:30:29]  ERROR  RollupError: virtual:#internal/nitro/virtual/plugins (6:7): Identifier "_BsBwid0Z5r" has already been declared


4: import _3SMM7tZjad from '/Users/daniel/code/danielroe/carpenter/node_modules/.pnpm/@nuxthub+core@0.5.11_ioredis@5.4.1...
5: import _BsBwid0Z5r from '/Users/daniel/code/danielroe/carpenter/node_modules/.pnpm/nitro-cloudflare-dev@0.1.4/node_mo...
6: import _BsBwid0Z5r from '/Users/daniel/code/danielroe/carpenter/node_modules/.pnpm/nitro-cloudflare-dev@0.1.4/node_mo...
          ^
7: 
8: export const plugins = [

The issue was user error - I was also using @nuxthub/core - but regardless, it seems like we should perhaps deduplicate?

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe requested a review from pi0 April 24, 2024 10:49
@pi0 pi0 changed the title fix: deduplicate nitro plugins before rendering fix: deduplicate plugins Apr 24, 2024
@pi0 pi0 merged commit 4293b8b into main Apr 24, 2024
5 checks passed
@pi0 pi0 deleted the fix/deduplicate-plugins branch April 24, 2024 19:12
@danielroe danielroe mentioned this pull request May 18, 2024
@pi0 pi0 mentioned this pull request Jun 13, 2024
pi0 pushed a commit that referenced this pull request Jun 27, 2024
@pi0 pi0 mentioned this pull request Jun 27, 2024
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.

2 participants