diff --git a/packages/svelte/src/reactivity/map.js b/packages/svelte/src/reactivity/map.js index c581a2791406..5572a76d4277 100644 --- a/packages/svelte/src/reactivity/map.js +++ b/packages/svelte/src/reactivity/map.js @@ -105,7 +105,12 @@ export class SvelteMap extends Map { increment(s); // if not every reaction of s is a reaction of version we need to also include version - const needs_version_increase = !s.reactions?.every((r) => version.reactions?.includes(r)); + var v_reactions = version.reactions === null ? null : new Set(version.reactions); + var needs_version_increase = + v_reactions === null || + !s.reactions?.every((r) => + /** @type {NonNullable} */ (v_reactions).has(r) + ); if (needs_version_increase) { increment(version); }