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

Đang mở
#2,256 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với ví dụ Svelte đơn giản tại examples/svelte/simple/src/App.svelte và tái hiện vấn đề trong CodeSandbox được liên kết bằng cách nhập vào trường tên trong khi theo dõi console. So sánh hành vi giữa các phiên bản 1.32.1 và 1.33.0; được xem là hoàn tất khi các lần gọi lặp lại field.handleChange() không còn tạo ra cảnh báo state_proxy_equality_mismatch.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

v1 v2: needs investigation
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.

Ngôn ngữ chính
TypeScript
Star
6.8k
Fork
705
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/form

Tất cả issue của TanStack/form

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.