Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/react-query/src/errorBoundaryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const ensurePreventErrorBoundaryRetry = <
TQueryKey extends QueryKey,
>(
options: DefaultedQueryObserverOptions<
TQueryFnData,
TError,
TQueryFnData
TError
Comment on lines +21 to +22

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. Generic type arguments in TypeScript must be separated by commas. The commas after TQueryFnData and TError are missing, which will cause the code to fail to compile.

    TQueryFnData,
    TError,

Comment on lines +21 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Add missing commas between the generic type arguments in the DefaultedQueryObserverOptions type argument list so the type parameters are correctly separated. [possible bug]

Severity Level: Critical 🚨

Suggested change
TQueryFnData
TError
TQueryFnData,
TError,
Why it matters? ⭐

The DefaultedQueryObserverOptions generic argument list in this file currently has the two type identifiers on separate lines without commas:

options: DefaultedQueryObserverOptions<
TQueryFnData
TError
TData,
...

That is invalid TypeScript generic syntax and will cause a compile error. Adding commas after TQueryFnData and TError fixes the syntax and restores the intended type argument list. I inspected packages/react-query/src/errorBoundaryUtils.ts and confirmed these exact lines are present in the PR.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** packages/react-query/src/errorBoundaryUtils.ts
**Line:** 21:22
**Comment:**
	*Possible Bug: Add missing commas between the generic type arguments in the DefaultedQueryObserverOptions type argument list so the type parameters are correctly separated.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

Comment on lines +21 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical syntax error: Missing comma between generic type parameters.

The comma separating TQueryFnData and TError has been removed, creating invalid TypeScript syntax. Generic type parameters must be comma-separated. This prevents the code from compiling, as confirmed by the static analysis tool and pipeline failures.

Apply this diff to restore the required comma:

   options: DefaultedQueryObserverOptions<
-    TQueryFnData
-    TError
+    TQueryFnData,
+    TError,
     TData,
     TQueryData,
     TQueryKey
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TQueryFnData
TError
TQueryFnData,
TError,
🧰 Tools
🪛 Biome (2.1.2)

[error] 22-22: expected , but instead found TError

Remove TError

(parse)

🤖 Prompt for AI Agents
In packages/react-query/src/errorBoundaryUtils.ts around lines 21 to 22, the
generic type parameter list has a missing comma between TQueryFnData and TError
which causes invalid TypeScript; restore the comma so the generic parameters are
comma-separated (i.e., change "TQueryFnData TError" to "TQueryFnData, TError")
and ensure the file compiles.

TData,
TQueryData,
TQueryKey
Expand Down
Loading