Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-zebras-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/nuxt": patch
---

Fixes an issue where duplicated imports caused warnings in the console.
6 changes: 5 additions & 1 deletion packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { LoadClerkJsScriptOptions } from '@clerk/shared/loadClerkJsScript';
import {
addComponent,
addImports,
addImportsDir,
addPlugin,
addServerHandler,
Expand Down Expand Up @@ -98,7 +99,10 @@ export default defineNuxtModule<ModuleOptions>({

// Add auto-imports for Clerk components, composables and client utils
addImportsDir(resolver.resolve('./runtime/composables'));
addImportsDir(resolver.resolve('./runtime/client'));
addImports({
name: 'createRouteMatcher',
from: resolver.resolve('./runtime/client'),
});
Comment on lines +102 to +105
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


// eslint-disable-next-line @typescript-eslint/consistent-type-imports
const components: Array<keyof typeof import('@clerk/vue')> = [
Expand Down