Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server-render): handling error in async setup #2881

Merged
merged 4 commits into from
Mar 26, 2021

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Dec 25, 2020

close #2736
I only dealt with the exception information in errorCaptured.
Because there is already a warning message in async setup and prefetch.
This is inconsistent with vue2.
IMO, there is no need to adjust.

  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()
    if (prefetch) {
      p = p.then(() => prefetch.call(instance.proxy)).catch(err => {
        warn(`[@vue/server-renderer]: Uncaught error in serverPrefetch:\n`, err)
      })
    }
    return p.then(() => renderComponentSubTree(instance))
  }

@edison1105 edison1105 changed the title fix(server-render): caught error in async setup and serverPrefetch fix(server-render): handling error in async setup Dec 25, 2020
@edison1105 edison1105 marked this pull request as draft December 25, 2020 07:32
@edison1105 edison1105 marked this pull request as ready for review December 25, 2020 09:54
@edison1105 edison1105 marked this pull request as draft December 25, 2020 10:01
@edison1105 edison1105 marked this pull request as ready for review December 25, 2020 10:09
@yyx990803 yyx990803 merged commit d668d48 into vuejs:master Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

errorCaptured not triggered by error in async setup during SSR
2 participants