diff --git a/.changeset/odd-schools-wait.md b/.changeset/odd-schools-wait.md new file mode 100644 index 0000000000..11fe1bdbac --- /dev/null +++ b/.changeset/odd-schools-wait.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +chore: untrack keyed validation logic diff --git a/packages/svelte/src/internal/client/validate.js b/packages/svelte/src/internal/client/validate.js index 831ccd9014..084d51d8f5 100644 --- a/packages/svelte/src/internal/client/validate.js +++ b/packages/svelte/src/internal/client/validate.js @@ -1,3 +1,4 @@ +import { untrack } from './runtime.js'; import { is_array } from './utils.js'; /** regex of all html void element names */ @@ -69,7 +70,7 @@ export function validate_dynamic_element_tag(tag_fn) { */ export function validate_each_keys(collection, key_fn) { const keys = new Map(); - const maybe_array = collection(); + const maybe_array = untrack(() => collection()); const array = is_array(maybe_array) ? maybe_array : maybe_array == null