Skip to content

Commit 48b1b1e

Browse files
committed
chore: tweak message
1 parent 97f87d1 commit 48b1b1e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/runtime-core/__tests__/components/Suspense.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ describe('Suspense', () => {
709709
<div v-if="errorMessage">{{ errorMessage }}</div>
710710
<Suspense v-else>
711711
<div>
712-
<Async />
712+
<Async />
713713
</div>
714714
<template #fallback>
715715
<div>fallback</div>
@@ -1250,7 +1250,7 @@ describe('Suspense', () => {
12501250
render(h(Parent), root)
12511251

12521252
expect(
1253-
`Component <Child>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. Therefore, this component can't render.`
1253+
`A component with async setup() must be nested in a <Suspense>`
12541254
).toHaveBeenWarned()
12551255
})
12561256
})

packages/runtime-core/src/component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,10 @@ function setupStatefulComponent(
670670
if (__DEV__ && !instance.suspense) {
671671
const name = Component.name ?? 'Anonymous'
672672
warn(
673-
`Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. Therefore, this component can't render.`
673+
`Component <${name}>: setup function returned a promise, but no ` +
674+
`<Suspense> boundary was found in the parent component tree. ` +
675+
`A component with async setup() must be nested in a <Suspense> ` +
676+
`in order to be rendered.`
674677
)
675678
}
676679
} else if (__DEV__) {

0 commit comments

Comments
 (0)