[angular-query] toResource causes console error with debounced validation
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 40/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- angular, typescript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- Run the example.
- Type any value into the input.
- 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.
- 主要语言
- TypeScript
- 星标
- 50.3k
- 派生
- 4.2k
- 平均合并
- 22 小时 33 分钟
- 30 天内合并 PR
- 214
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/query 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 78/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·