TanStack / TanStack/form

Svelte form - `state_proxy_equality_mismatch` warnings when calling `field.handleChange()`

Open
#2,256 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

v1 v2: needs investigation
Dominant language
TypeScript
Stars
6.7k
Forks
682
Avg merge
5d 18h
Merged PRs (30d)
7

Description

Describe the bug

Each call to field.handleChange() generates multiple state_proxy_equality_mismatch svelte warning in console.

Your minimal, reproducible example

https://codesandbox.io/p/devbox/github/tanstack/form/tree/main/examples/svelte/simple?embed=1&theme=dark&file=src/App.svelte

Steps to reproduce
  1. Open the simple example for svelte form - https://codesandbox.io/p/devbox/github/tanstack/form/tree/main/examples/svelte/simple?embed=1&theme=dark&file=src/App.svelte
  2. Open devtools console
  3. Type anything into first name
  4. Each keystroke generates 7 state_proxy_equality_mismatch warnings in console.
Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `===` will produce unexpected results
Expected behavior

I expect no warning to be in console.

How often does this bug happen?

Every time

Screenshots or Videos
Image
Platform
  • Chrome 150
  • Rocky Linux
TanStack Form adapter

svelte-form

TanStack Form version

1.33.2

TypeScript version

No response

Additional context

The warning appears in version 1.33.0 and up. They do not appear in version 1.32.1 and lower.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Svelte simple example at examples/svelte/simple/src/App.svelte and reproduce the issue in the linked CodeSandbox by typing in the first-name field while watching the console. Compare behavior between versions 1.32.1 and 1.33.0; done means repeated field.handleChange() calls no longer produce state_proxy_equality_mismatch warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.