@@ -217,22 +217,27 @@ export function createComponent(
217217 : EMPTY_OBJ
218218
219219 const isAsyncSetup = isPromise ( setupResult )
220- if ( __FEATURE_SUSPENSE__ && isAsyncSetup ) {
221- // async setup returned Promise.
222- // bail here and wait for re-entry.
223- instance . asyncDep = setupResult
224- if ( __DEV__ && ! instance . suspense ) {
225- const name = getComponentName ( component , true ) ?? 'Anonymous'
220+ if ( isAsyncSetup ) {
221+ if ( __FEATURE_SUSPENSE__ ) {
222+ // async setup returned Promise.
223+ // bail here and wait for re-entry.
224+ instance . asyncDep = setupResult
225+ if ( __DEV__ && ! instance . suspense ) {
226+ const name = getComponentName ( component ) ?? 'Anonymous'
227+ warn (
228+ `Component <${ name } >: setup function returned a promise, but no ` +
229+ `<Suspense> boundary was found in the parent component tree. ` +
230+ `A component with async setup() must be nested in a <Suspense> ` +
231+ `in order to be rendered.` ,
232+ )
233+ }
234+ } else if ( __DEV__ ) {
226235 warn (
227- `Component <${ name } >: setup function returned a promise, but no ` +
228- `<Suspense> boundary was found in the parent component tree. ` +
229- `A component with async setup() must be nested in a <Suspense> ` +
230- `in order to be rendered.` ,
236+ `setup() returned a Promise, but the version of Vue you are using ` +
237+ `does not support it yet.` ,
231238 )
232239 }
233- }
234-
235- if ( ! isAsyncSetup ) {
240+ } else {
236241 handleSetupResult ( setupResult , component , instance , isSingleRoot , setupFn )
237242 }
238243
@@ -532,8 +537,8 @@ export function handleSetupResult(
532537 setupResult : any ,
533538 component : VaporComponent ,
534539 instance : VaporComponentInstance ,
535- isSingleRoot : boolean | undefined ,
536- setupFn : VaporSetupFn | undefined ,
540+ isSingleRoot ? : boolean ,
541+ setupFn ? : VaporSetupFn ,
537542) : void {
538543 if ( __DEV__ ) {
539544 pushWarningContext ( instance )
0 commit comments