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
@ -318,7 +318,7 @@ const render404Page = () => {
|
|||||||
// Call asyncData(context)
|
// Call asyncData(context)
|
||||||
if (Component.options.asyncData && typeof Component.options.asyncData === 'function') {
|
if (Component.options.asyncData && typeof Component.options.asyncData === 'function') {
|
||||||
const promise = promisify(Component.options.asyncData, app.context)
|
const promise = promisify(Component.options.asyncData, app.context)
|
||||||
promise.then((asyncDataResult) => {
|
.then((asyncDataResult) => {
|
||||||
ssrContext.asyncData[Component.cid] = asyncDataResult
|
ssrContext.asyncData[Component.cid] = asyncDataResult
|
||||||
applyAsyncData(Component)
|
applyAsyncData(Component)
|
||||||
return asyncDataResult
|
return asyncDataResult
|
||||||
|
Loading…
Reference in New Issue
Block a user