From 0cd5a13b1c639af6801911e57c792830e8ae6c3e Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Thu, 19 Dec 2024 19:19:11 -0800 Subject: [PATCH 1/2] fix(nuxt): Optimize @clerk/vue --- packages/nuxt/src/module.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index bc606a1e4a..114b4918c7 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -79,6 +79,11 @@ export default defineNuxtModule({ // Handle Nuxt-specific imports (e.g #imports) nuxt.options.build.transpile.push(resolver.resolve('./runtime')); + // Optimize @clerk/vue to avoid missing injection Symbol key errors + nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {}; + nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || []; + nuxt.options.vite.optimizeDeps.include.push('@clerk/vue'); + // Add the `@clerk/vue` plugin addPlugin(resolver.resolve('./runtime/plugin')); From 29f041ada4d24fad8791bce217e7eed247e3340e Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Thu, 19 Dec 2024 19:30:35 -0800 Subject: [PATCH 2/2] chore: add changeset --- .changeset/shy-mangos-visit.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/shy-mangos-visit.md diff --git a/.changeset/shy-mangos-visit.md b/.changeset/shy-mangos-visit.md new file mode 100644 index 0000000000..b57d839d71 --- /dev/null +++ b/.changeset/shy-mangos-visit.md @@ -0,0 +1,5 @@ +--- +"@clerk/nuxt": patch +--- + +Fix Vite optimization issue that caused duplicate versions of @clerk/vue to be created on first load, resulting in the Vue plugin losing context.