Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[angular-query] toResource causes console error with debounced validation

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

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

Đá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
40/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
angular, typescript
Lĩnh vực
frontend, testing

Hướng nghiên cứu

Examine the Angular Query integration, specifically the toResource() helper and its interaction with Signal Forms' validateAsync debounce. Start by reviewing the provided StackBlitz example to see the error in action. Look at the relevant source files for toResource and the Signal Forms integration. Understand how debounced validation triggers a LOADING state and why it causes a console error. Check the existing tests for toResource and validation to see if they cover this scenario.

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

Mô tả

Describe the bug

First, thank you for publishing the stable Angular Query RC and for adding the new toResource() integration in #11516.

I found an issue when using toResource(injectQuery(...)) with Signal Forms validateAsync() and its debounce option. While the debounce is pending, Angular reports the following global console error:

ERROR ResourceParamsStatus: LOADING

The query itself succeeds and validation completes. The error occurs while the debounced validator parameter is loading.

Removing the debounce option from validateAsync makes the console error disappear.

This seems related to the Signal Forms integration discussed in https://github.com/TanStack/query/discussions/10788. The current design of this helper might need to be reconsidered so that it can better support this use case as well.

Your minimal, reproducible example

https://stackblitz.com/edit/stackblitz-starters-rq6qsn9u?file=src%2Fmain.ts

Steps to reproduce
  1. Run the example.
  2. Type any value into the  input.
  3. Observe the browser console while the 200 ms debounce is pending.
Expected behavior

The validator should enter its pending state and then resolve without reporting a global error.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • @angular/core :  22.1.7 
  • Browser: Chromium
  • Operating system: macOS
Tanstack Query adapter

angular-query

TanStack Query version

v5.0.0-rc.0

TypeScript version

6.0.2

Additional context

The traditional approach to define a resource using

resource({
    params,
    loader: ({ params }) => queryClient.query(options(params)),
})

works due to loader only executing once the params are available.

Ngôn ngữ chính
TypeScript
Star
50.3k
Fork
4.2k
Merge trung bình
22 giờ 33 phút
Pull request đã merge (30 ngày)
214

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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/query

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

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.