fix(runtime-core): handle error in async setup (#2881)

This commit is contained in:
edison
2021-03-26 22:26:30 +08:00
committed by GitHub
parent abd129d845
commit d668d48e9e
3 changed files with 52 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ import {
} from './componentProps'
import { Slots, initSlots, InternalSlots } from './componentSlots'
import { warn } from './warning'
import { ErrorCodes, callWithErrorHandling } from './errorHandling'
import { ErrorCodes, callWithAsyncErrorHandling } from './errorHandling'
import { AppContext, createAppContext, AppConfig } from './apiCreateApp'
import { Directive, validateDirectiveName } from './directives'
import {
@@ -579,7 +579,7 @@ function setupStatefulComponent(
currentInstance = instance
pauseTracking()
const setupResult = callWithErrorHandling(
const setupResult = callWithAsyncErrorHandling(
setup,
instance,
ErrorCodes.SETUP_FUNCTION,