`suspensible` option throws error when child of suspense is not async
Vue version
3.3.0-beta.3
Link to minimal reproduction
Steps to reproduce
<script setup>
import { defineAsyncComponent, h } from 'vue'
const Sync = {
setup() {
return () => h('div', 'hi there')
}
}
const Async = defineAsyncComponent(async () => {
await new Promise(resolve => setTimeout(resolve, 500))
return Sync
})
</script>
<template>
<Suspense>
<div>
<Suspense suspensible>
<Sync />
</Suspense>
</div>
</Suspense>
</template>
Load page with a synchronous component under <Suspense suspensible>
and the following error will be displayed:
suspense.resolve() is called without a pending branch.
I believe this is because there is no suspense needed for the child of the second suspense. When replacing the <Sync>
with <Async>
, everything works as expected.
What is expected?
I expect that <Suspense suspensible>
should work with both async + sync components.
What is actually happening?
It only works with async components.
System Info
No response
Any additional comments?
See https://github.com/vuejs/core/issues/5513, https://github.com/vuejs/core/pull/6736.
I'm still experiencing this on beta5 (with SSR):
The linked PR did seem to fully resolve the issue when locally testing.