Skip to content

Commit 389133b

Browse files
authored
fix(nuxt): Optimize @clerk/vue (#4820)
1 parent fa8be89 commit 389133b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/shy-mangos-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/nuxt": patch
3+
---
4+
5+
Fix Vite optimization issue that caused duplicate versions of @clerk/vue to be created on first load, resulting in the Vue plugin losing context.

packages/nuxt/src/module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export default defineNuxtModule<ModuleOptions>({
7979
// Handle Nuxt-specific imports (e.g #imports)
8080
nuxt.options.build.transpile.push(resolver.resolve('./runtime'));
8181

82+
// Optimize @clerk/vue to avoid missing injection Symbol key errors
83+
nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {};
84+
nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [];
85+
nuxt.options.vite.optimizeDeps.include.push('@clerk/vue');
86+
8287
// Add the `@clerk/vue` plugin
8388
addPlugin(resolver.resolve('./runtime/plugin'));
8489

0 commit comments

Comments
 (0)