From 55e6f5d4a41ea6008597b5d533227d1888732c04 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 28 Jul 2023 12:12:41 +0200 Subject: [PATCH] fix: use `allSettled` for promises --- packages/nuxt/src/app/components/route-provider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/components/route-provider.ts b/packages/nuxt/src/app/components/route-provider.ts index 624c47ee03..dd73fd288d 100644 --- a/packages/nuxt/src/app/components/route-provider.ts +++ b/packages/nuxt/src/app/components/route-provider.ts @@ -62,7 +62,8 @@ export const RouteProvider = defineComponent({ const ResolvePendingPromises = defineComponent({ async setup () { const nuxtApp = useNuxtApp() - await Promise.all(Object.values(nuxtApp._asyncDataPromises).filter(p => p?.strategy !== 'lazy')) + const promises = Object.values(nuxtApp._asyncDataPromises).filter(p => p?.strategy !== 'lazy') + await (Promise.allSettled?.(promises) ?? Promise.all(promises).catch(() => {})) }, render: () => null })