diff --git a/packages/query-core/src/queriesObserver.ts b/packages/query-core/src/queriesObserver.ts index a15139d24e..ea0ca7b02a 100644 --- a/packages/query-core/src/queriesObserver.ts +++ b/packages/query-core/src/queriesObserver.ts @@ -91,6 +91,15 @@ export class QueriesObserver< this.#queries = queries this.#options = options + if (process.env.NODE_ENV !== 'production') { + const queryHashes = queries.map((query) => query.queryHash) + if (new Set(queryHashes).size !== queryHashes.length) { + console.warn( + '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.', + ) + } + } + notifyManager.batch(() => { const prevObservers = this.#observers