Skip to content

Conversation

@FrankFMY
Copy link
Contributor

@FrankFMY FrankFMY commented Feb 6, 2026

Summary

Fixes #13768

<select bind:value={derived.prop}> in legacy (non-runes) components throws effect_update_depth_exceeded when the bound value comes from a $: reactive statement.

Root cause: setup_select_synchronization created a template_effect that called invalidate_inner_signals, which reads and writes the same signals on every change — creating an infinite update loop when those signals feed back into derived state.

Fix: Remove the effect-based synchronization entirely. Instead, populate legacy_indirect_bindings during the analyze phase for <select bind:value> elements, and call invalidate_inner_signals inline at the mutation point in AssignmentExpression — only when the binding is actually mutated, avoiding the read-write cycle.

Based on the approach outlined in #16200.

Changes

  • scope.js: Add legacy_indirect_bindings field to Binding class
  • RegularElement.js (analyze): For <select bind:value={foo}>, collect scope references as indirect bindings on the bound variable
  • RegularElement.js (transform): Remove setup_select_synchronization function and its call site
  • AssignmentExpression.js (transform): When mutating a binding with indirect bindings, append invalidate_inner_signals call after the mutation

Test plan

…egacy mode

Move select value synchronization from a template_effect (which caused
infinite loops when bound value derived from reactive statements) to
the mutation point in AssignmentExpression. When a binding with indirect
dependencies is mutated, invalidate_inner_signals is called inline
instead of through an effect that re-reads the same signals.

Closes sveltejs#13768
@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

🦋 Changeset detected

Latest commit: 81944a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@FrankFMY FrankFMY requested a deployment to Publish pkg.pr.new (external contributors) February 6, 2026 16:50 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken page with Svelte 5: uncaught effect_update_depth_exceeded

1 participant