Skip to content

Commit

Permalink
fix(nuxt): Optimize @clerk/vue (#4820)
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano authored Dec 20, 2024
1 parent fa8be89 commit 389133b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-mangos-visit.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export default defineNuxtModule<ModuleOptions>({
// 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'));

Expand Down

0 comments on commit 389133b

Please sign in to comment.