mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(vue-app): handle promise rejection from asyncData
(#18585)
This commit is contained in:
parent
751b784d21
commit
6fa5fc2fa0
@ -317,16 +317,16 @@ const render404Page = () => {
|
||||
<% if (features.asyncData) { %>
|
||||
// Call asyncData(context)
|
||||
if (Component.options.asyncData && typeof Component.options.asyncData === 'function') {
|
||||
const promise = promisify(Component.options.asyncData, app.context)
|
||||
promise.then((asyncDataResult) => {
|
||||
const promise = promisify(Component.options.asyncData, app.context)
|
||||
.then((asyncDataResult) => {
|
||||
ssrContext.asyncData[Component.cid] = asyncDataResult
|
||||
applyAsyncData(Component)
|
||||
return asyncDataResult
|
||||
})
|
||||
promises.push(promise)
|
||||
} else {
|
||||
promises.push(null)
|
||||
}
|
||||
promises.push(promise)
|
||||
} else {
|
||||
promises.push(null)
|
||||
}
|
||||
<% } %>
|
||||
|
||||
<% if (features.fetch) { %>
|
||||
|
Loading…
Reference in New Issue
Block a user