fix: use allSettled for promises

This commit is contained in:
Daniel Roe 2023-07-28 12:12:41 +02:00
parent c07db7ee6f
commit 55e6f5d4a4

View File

@ -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
})