8000 fix(nuxt): provide `nuxtApp` for asyncData functions run on server (#… · nuxt/nuxt@c516774 · GitHub
[go: up one dir, main page]

Skip to content

Commit c516774

Browse files
xjcccdanielroe
authored andcommitted
fix(nuxt): provide nuxtApp for asyncData functions run on server (#32038)
1 parent e7ba9f9 commit c516774

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/nuxt/src/app/composables/asyncData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ function createAsyncData<
621621
const value = nuxtApp.ssrContext!._sharedPrerenderCache!.get(key)
622622
if (value) { return value as Promise<ResT> }
623623

624-
const promise = Promise.resolve().then(() => nuxtApp.runWithContext(_handler))
624+
const promise = Promise.resolve().then(() => nuxtApp.runWithContext(() => _handler(nuxtApp)))
625625

626626
nuxtApp.ssrContext!._sharedPrerenderCache!.set(key, promise)
627627
return promise

0 commit comments

Comments
 (0)
0