Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#11,586 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
40/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
angular, typescript
Área
frontend, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
50.3k
Forks
4.2k
Merge medio
22 h 33 min
PR fusionados (30 d)
214

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/query

Todos los issues de TanStack/query

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.