Skip to content

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Feb 24, 2025

Description

This PR resolves the duplicated imports warning in the Nuxt module related to the createRouteMatcher function. The issue was caused by using addImportsDir, which imported all files in the client folder, including both index.ts and routeMatcher.ts.

Before:

Screenshot 2025-02-24 at 9 39 34 AM

After:

fix.mov

Resolves ECO-435
Fixes #5214

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2025

🦋 Changeset detected

Latest commit: 2bcf74a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/nuxt Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 25, 2025 9:49am

@wobsoriano
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @wobsoriano - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.0.4-snapshot.v20250224173645
@clerk/astro 2.3.0-snapshot.v20250224173645
@clerk/backend 1.24.3-snapshot.v20250224173645
@clerk/chrome-extension 2.2.11-snapshot.v20250224173645
@clerk/clerk-js 5.54.0-snapshot.v20250224173645
@clerk/elements 0.23.0-snapshot.v20250224173645
@clerk/clerk-expo 2.8.0-snapshot.v20250224173645
@clerk/expo-passkeys 0.1.22-snapshot.v20250224173645
@clerk/express 1.3.50-snapshot.v20250224173645
@clerk/fastify 2.1.23-snapshot.v20250224173645
@clerk/localizations 3.10.8-snapshot.v20250224173645
@clerk/nextjs 6.12.1-snapshot.v20250224173645
@clerk/nuxt 1.2.1-snapshot.v20250224173645
@clerk/clerk-react 5.24.0-snapshot.v20250224173645
@clerk/react-router 1.1.1-snapshot.v20250224173645
@clerk/remix 4.5.1-snapshot.v20250224173645
@clerk/shared 2.23.0-snapshot.v20250224173645
@clerk/tanstack-start 0.10.1-snapshot.v20250224173645
@clerk/testing 1.4.24-snapshot.v20250224173645
@clerk/themes 2.2.20-snapshot.v20250224173645
@clerk/types 4.47.0-snapshot.v20250224173645
@clerk/ui 0.3.25-snapshot.v20250224173645
@clerk/vue 1.3.0-snapshot.v20250224173645

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.0.4-snapshot.v20250224173645 --save-exact

@clerk/astro

npm i @clerk/astro@2.3.0-snapshot.v20250224173645 --save-exact

@clerk/backend

npm i @clerk/backend@1.24.3-snapshot.v20250224173645 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.2.11-snapshot.v20250224173645 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.54.0-snapshot.v20250224173645 --save-exact

@clerk/elements

npm i @clerk/elements@0.23.0-snapshot.v20250224173645 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.8.0-snapshot.v20250224173645 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@0.1.22-snapshot.v20250224173645 --save-exact

@clerk/express

npm i @clerk/express@1.3.50-snapshot.v20250224173645 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.23-snapshot.v20250224173645 --save-exact

@clerk/localizations

npm i @clerk/localizations@3.10.8-snapshot.v20250224173645 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.12.1-snapshot.v20250224173645 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.2.1-snapshot.v20250224173645 --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.24.0-snapshot.v20250224173645 --save-exact

@clerk/react-router

npm i @clerk/react-router@1.1.1-snapshot.v20250224173645 --save-exact

@clerk/remix

npm i @clerk/remix@4.5.1-snapshot.v20250224173645 --save-exact

@clerk/shared

npm i @clerk/shared@2.23.0-snapshot.v20250224173645 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.10.1-snapshot.v20250224173645 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.24-snapshot.v20250224173645 --save-exact

@clerk/themes

npm i @clerk/themes@2.2.20-snapshot.v20250224173645 --save-exact

@clerk/types

npm i @clerk/types@4.47.0-snapshot.v20250224173645 --save-exact

@clerk/ui

npm i @clerk/ui@0.3.25-snapshot.v20250224173645 --save-exact

@clerk/vue

npm i @clerk/vue@1.3.0-snapshot.v20250224173645 --save-exact

Comment on lines +102 to +105
addImports({
name: 'createRouteMatcher',
from: resolver.resolve('./runtime/client'),
});
Copy link
Member Author

@wobsoriano wobsoriano Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to using addImports (instead of addImportsDir which auto-imports to whole directory) to have more control over the auto-imported functions with a single point of import

@LekoArts LekoArts merged commit 4772034 into main Feb 25, 2025
29 checks passed
@LekoArts LekoArts deleted the rob/eco-435-duplicated-imports-createroutematcher-on-nuxt branch February 25, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated imports "createRouteMatcher" on Nuxt

4 participants