Hydration error using loading state of useQuery when prefetching
Maintainer thường phản hồi trong vòng 1 ngày
@DogPawHat đang làm issue này rồi.
Từ ngày 15/9/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu với bản tái hiện StackBlitz được liên kết và lần theo luồng prefetch của server, hydration của client và quá trình render useQuery isLoading. Đọc issue tRPC liên quan để biết ngữ cảnh; công việc được xem là hoàn tất khi bản tái hiện không còn tạo ra lỗi hydration sau khi build và khởi động project.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
If you prefetch data on the server and then use useQuery with isLoading on the client, it can lead to a hydration error.
Your minimal, reproducible example
https://stackblitz.com/~/github.com/Icestonks/react-query-trpc-test
Steps to reproduce
- Prefetch something on the server
- Hydrate it to the client
- Use
useQueryin the client, and have a loading fallback withisLoading.
Then there should come a hydration error.
Expected behavior
When first building and starting the project, we should see an hydration error. The error can also come at other times, but that's the most reliable way, to get the error to occur.
How often does this bug happen?
Sometimes
Screenshots or Videos
Platform
- OS: Windows
- Browser: Google Chrome
- Browser version: 138.0.7204.100
Tanstack Query adapter
react-query
TanStack Query version
5.82.0
TypeScript version
5.8.3
Additional context
Initially, the issue was thought to be related to tRPC, so there has been some discussion about the error over there: https://github.com/trpc/trpc/issues/6740
Would highly recommend reading some of the comments from that issue. Could maybe also give some more context.
- Ngôn ngữ chính
- TypeScript
- Star
- 50.4k
- Fork
- 4.2k
- Merge trung bình
- 11 giờ 33 phút
- Pull request đã merge (30 ngày)
- 421
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/query
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TanStack/query#11358 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
solid-query: switching the queryClient accessor strands the new client's cache (subscription stays on the old observer)Có thể đã có người làm @MaNaN1803 đã nhận 75 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TanStack/query#11106 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
setQueryData: NoInfer loses discriminated-union members when spreading a narrowed updater valueCó thể đã có người làm @iosayin đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
setQueryData updater loses discriminated-union fields when spreading inferred NoInfer dataCó thể đã có người làm @boriskozak đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
TanStack/query#11794 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/query
Issue tương tự
-
area:docs bug triage:confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Cotal-AI/Cotal#2875 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GLM-5.3 available on bedrock nowĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
anomalyco/models.dev#8862 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(data-lake): wizard source step still previews the local slug, not the server-disambiguated oneĐang mởdata-lake
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ready-for-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
konflux-ci/konflux-ui#1596 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue priority: low size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày