You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
useSuspenseQueriescombine is called with pending/error results despite types implying data is always defined #10129
The combine function in useSuspenseQueries has types that narrow data to always be defined (non-undefined), implying it should only be called when all queries have successfully resolved. However, combine is actually invoked via QueriesObserver.#combineResult in the #notify path even when query results are in pending or error state (e.g., after queryClient.resetQueries() or when a query errors out).
This causes a runtime TypeError because user code in combine reasonably accesses .data without null checks — as the types suggest it is safe to do so.
Confirm that loading... is displayed on the initial load.
Open the console in the Preview panel.
In DevTools, select a query and trigger loading or trigger error. Or click the reset query button.
Uncaught TypeError: Cannot read properties of undefined (reading 'full_name') error is thrown.
Expected behavior
One of the following:
If combine is intended to only receive successful results, combine should not be called when any query result is in a non-success state. The observer notification path should skip the combine optimization and let the framework render path handle suspension or error boundaries.
If combine is intended to handle all states, The type signature of combine in useSuspenseQueries should reflect that data can be undefined, matching the runtime behavior.
This is a type/runtime mismatch. useSuspenseQueries types tell you that data is always defined inside combine, which makes sense for the suspense contract (component shouldnt render until all queries succeed). But in practice, combine runs through QueriesObserver.#combineResult which gets called even when query states change to pending or error (e.g. after queryClient.resetQueries()).
So the types promise "data is always there" but the runtime doesnt enforce that during state transitions.
The proper fix from the library side would be to skip calling combine when any query result isnt in success state. The observer notification should fall through to the suspense/error boundary handling instead of running combine with incomplete data.
Activity
fix(query-core): handle combine throwing in QueriesObserver#notify
fix(query-core): handle combine throwing in QueriesObserver#notify
idirdev commentedon Mar 11, 2026
This is a type/runtime mismatch. useSuspenseQueries types tell you that
datais always defined inside combine, which makes sense for the suspense contract (component shouldnt render until all queries succeed). But in practice, combine runs through QueriesObserver.#combineResult which gets called even when query states change to pending or error (e.g. after queryClient.resetQueries()).So the types promise "data is always there" but the runtime doesnt enforce that during state transitions.
The proper fix from the library side would be to skip calling combine when any query result isnt in success state. The observer notification should fall through to the suspense/error boundary handling instead of running combine with incomplete data.
As a defensive workaround in the meantime:
Not ideal since the types say you shouldnt need this, but it prevents the runtime crash.
fix(query-core): handle combine throwing in QueriesObserver#notify