Subscribe on changes!

Using Suspense and KeepAlive yields to error when component with async dependencies is not completed

avatar
Apr 19th 2023

Vue version

3.2.47

Link to minimal reproduction

Vue SFC Playground

Steps to reproduce

Click on toggle button twice quickly to force the second component not to fullfill the promise.

Then click again to load that "pending" component and you will see an error: Uncaught (in promise): Cannot read properties of null (reading 'parentNode')

I think KeepAlive is caching the component even if async dependencies are not completed?

What is expected?

KeepAlive should not cache component with async dependencies after they are fullfiled? Suspense should trigger pending state.

What is actually happening?

An error is thrown

System Info

No response

Any additional comments?

No response

avatar
Apr 19th 2023

Maybe related: #8105

avatar
Nov 29th 2023

duplicate of #5993