fix: use `allSettled` for promises

This commit is contained in:
Daniel Roe 2023-07-28 12:12:41 +02:00
parent c07db7ee6f
commit 55e6f5d4a4
1 changed files with 2 additions and 1 deletions

View File

@ -62,7 +62,8 @@ export const RouteProvider = defineComponent({
const ResolvePendingPromises = defineComponent({ const ResolvePendingPromises = defineComponent({
async setup () { async setup () {
const nuxtApp = useNuxtApp() 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 render: () => null
}) })