Skip to content

Commit 610ba68

Browse files
authored
fix: Prevent redundant function call error in dev mode (#8877)
1 parent cf7b375 commit 610ba68

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/query-core/src/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,9 @@ export function replaceData<
373373
console.error(
374374
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,
375375
)
376+
377+
// Prevent the replaceEqualDeep from being called again down below.
378+
throw error
376379
}
377380
}
378381
// Structurally share data between prev and new data if needed

0 commit comments

Comments
 (0)