Skip to content

Commit 82d75b7

Browse files
committed
chore: message
1 parent 93d14ec commit 82d75b7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/query-core/src/__tests__/query.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,9 @@ describe('query', () => {
10051005
expect(queryFn).toHaveBeenCalledTimes(1)
10061006

10071007
expect(consoleMock).toHaveBeenCalledWith(
1008-
expect.stringContaining('Data is not serializable'),
1008+
expect.stringContaining(
1009+
'StructuralSharing requires data to be JSON serializable',
1010+
),
10091011
)
10101012

10111013
expect(query.state.status).toBe('error')

packages/query-core/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export function replaceData<
359359
JSON.stringify(data)
360360
} catch (error) {
361361
console.error(
362-
`Data is not serializable. [${options.queryHash}]: ${error}; The error will be redacted in production builds`,
362+
`StructuralSharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,
363363
)
364364

365365
throw new Error('Data is not serializable')

0 commit comments

Comments
 (0)