diff --git a/packages/kit/src/module/define.ts b/packages/kit/src/module/define.ts index d1f2fb120f..2c2a6b6eea 100644 --- a/packages/kit/src/module/define.ts +++ b/packages/kit/src/module/define.ts @@ -160,9 +160,9 @@ function nuxt2Shims (nuxt: Nuxt) { nuxt.hooks = nuxt // Allow using useNuxt() - if (!nuxtCtx.tryUse()) { - nuxtCtx.set(nuxt) - nuxt.hook('close', () => nuxtCtx.unset()) + if (!nuxtCtx().tryUse()) { + nuxtCtx().set(nuxt) + nuxt.hook('close', () => nuxtCtx().unset()) } // Support virtual templates with getContents() by writing them to .nuxt directory