From b14f3dc2d5f21f7708f1aa71bb1b04c25e838977 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Sat, 11 Jan 2025 17:33:27 +0100 Subject: [PATCH] fix --- packages/kit/src/module/define.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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