Skip to content

Svelte 5: Reactivity bug in REPL #10062

Closed
@JVariance

Description

@JVariance

Describe the bug

This bug appears only in the REPL. It works locally.

<script>
	let objArray = $state([{a: 1, b:2}, {a: 3, b:4}]);
</script>

<button onclick={() => {objArray = [{a: 8, b:2}, {a: 12, b:4}]}}>
	change
</button>
{#each objArray as c}
	<p>{c.a} - {c.b}</p>
	<input bind:value={c.a}/>
{/each}
  • If I change the input value, the state is updated
  • If I press the change button and afterwards change the input value, the state is also updated
  • BUT If I press the button multiple times and then change the input value, the state is NOT updated anymore

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACk3OwWrDMBAE0F9Ztj0k4MYk7aGosiHfEecgy5tGqSIJaxUIQv9e5BaS4wzDYzKejKWI4pDRqSuhwH0I2CDfQw3xRpYJG4w-zbo2MurZBO4HN7AlBj9e9vOs7tDBa2TFtDpkJWDbwCh2pYEa3mv4KMf11-Bk-wCcHBOzd-Cdtkb_dHm1hq6H_IQu2ueztt39c6UsL_RZuW-q8p_WDy6_kNLnxzcVQZe6laHPeqMKvEHWm7HINiyGNC4khtG4SdyUTdQts7ZabbUKNnj1kzkZmlDwnKgcyy8nbhi7PgEAAA==

Logs

No response

System Info

Svelte v5.0.0-next.27

Severity

annoyance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions