From 47ac6bb84347a72d276bfe42a8ad56cc4f646ad7 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Fri, 23 Aug 2024 00:08:19 +0200 Subject: [PATCH] fix(nuxt): don't wrap setup with runWithContext --- packages/nuxt/src/app/composables/component.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/component.ts b/packages/nuxt/src/app/composables/component.ts index ebc234226c..f508c45b54 100644 --- a/packages/nuxt/src/app/composables/component.ts +++ b/packages/nuxt/src/app/composables/component.ts @@ -47,8 +47,7 @@ export const defineNuxtComponent: typeof defineComponent = _fetchKeyBase: key, ...options, setup (props, ctx) { - const nuxtApp = useNuxtApp() - const res = setup ? Promise.resolve(nuxtApp.runWithContext(() => setup(props, ctx))).then(r => r || {}) : {} + const res = setup ? setup(props, ctx) : {} const promises: Promise[] = [] if (options.asyncData) {