-
-
Notifications
You must be signed in to change notification settings - Fork 9k
Description
Vue version
3.5.13
Link to minimal reproduction
Steps to reproduce
- Click the
togglebutton
What is expected?
The Suspense component unmounts without an error.
What is actually happening?
The Suspense component unmounts, but the app crashes - the error pops up and the toggle button no longer works.
System Info
Any additional comments?
I was trying to implement a loader for async components with some reload logic (retries, reload when connection is restored - things like that). And one of the components had a client-only logic in it: it was rendering the actual content only after the mounted hook. I didn't use the errorComponent/onError from the AsyncComponentOptions because i needed to reload the component again, so i used Suspense and its fallback slot.
I understand that Suspense is experimental and i have been able to resolve this issue in my project by wrapping the template of the async component in a static div, but the issue itself is there.