fix(ssr): ensure async setup error handling work with suspense during ssr
This commit is contained in:
@@ -89,11 +89,7 @@ export function renderComponentVNode(
|
||||
const hasAsyncSetup = isPromise(res)
|
||||
const prefetch = (vnode.type as ComponentOptions).serverPrefetch
|
||||
if (hasAsyncSetup || prefetch) {
|
||||
let p = hasAsyncSetup
|
||||
? (res as Promise<void>).catch(err => {
|
||||
warn(`[@vue/server-renderer]: Uncaught error in async setup:\n`, err)
|
||||
})
|
||||
: Promise.resolve()
|
||||
let p = hasAsyncSetup ? (res as Promise<void>) : Promise.resolve()
|
||||
if (prefetch) {
|
||||
p = p.then(() => prefetch.call(instance.proxy)).catch(err => {
|
||||
warn(`[@vue/server-renderer]: Uncaught error in serverPrefetch:\n`, err)
|
||||
|
||||
Reference in New Issue
Block a user