diff --git a/code/core/src/preview-api/modules/preview-web/render/animation-utils.ts b/code/core/src/preview-api/modules/preview-web/render/animation-utils.ts index 385e39b5ffef..994ae82438ed 100644 --- a/code/core/src/preview-api/modules/preview-web/render/animation-utils.ts +++ b/code/core/src/preview-api/modules/preview-web/render/animation-utils.ts @@ -78,7 +78,8 @@ export async function waitForAnimations(signal?: AbortSignal) { .flatMap((el) => el?.getAnimations?.() || []) .filter((a) => a.playState === 'running' && !isInfiniteAnimation(a)); if (runningAnimations.length > 0) { - await Promise.all(runningAnimations.map((a) => a.finished)); + // Treat any errors (e.g. AbortError) from `finished` as also finished, even though not successfully so + await Promise.allSettled(runningAnimations.map(async (a) => a.finished)); await checkAnimationsFinished(); } };