From: daiwei Date: Tue, 10 Jun 2025 03:26:36 +0000 (+0800) Subject: fix(suspense): don't immediately resolve suspense on last dep unmount X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5966fec206b689b970a937e89cbbd34a12ed013b;p=thirdparty%2Fvuejs%2Fcore.git fix(suspense): don't immediately resolve suspense on last dep unmount because new vnodes may contain async components --- diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index a57be791a4..16ed847076 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -2332,24 +2332,6 @@ function baseCreateRenderer( instance.isUnmounted = true }, parentSuspense) - // A component with async dep inside a pending suspense is unmounted before - // its async dep resolves. This should remove the dep from the suspense, and - // cause the suspense to resolve immediately if that was the last dep. - if ( - __FEATURE_SUSPENSE__ && - parentSuspense && - parentSuspense.pendingBranch && - !parentSuspense.isUnmounted && - instance.asyncDep && - !instance.asyncResolved && - instance.suspenseId === parentSuspense.pendingId - ) { - parentSuspense.deps-- - if (parentSuspense.deps === 0) { - parentSuspense.resolve() - } - } - if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { devtoolsComponentRemoved(instance) }