Skip to content

Commit

Permalink
fix(nuxt): use callAsync for executing hooks with context (#20510)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Apr 26, 2023
1 parent 9170a72 commit 7ab476b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export function createNuxtApp (options: CreateOptions) {
if (process.server) {
async function contextCaller (hooks: HookCallback[], args: any[]) {
for (const hook of hooks) {
await nuxtAppCtx.call(nuxtApp, () => hook(...args))
await nuxtAppCtx.callAsync(nuxtApp, () => hook(...args))
}
}
// Patch callHook to preserve NuxtApp context on server
Expand Down

0 comments on commit 7ab476b

Please sign in to comment.