T
TanStack11mo ago
conventional-tan

A query that was dehydrated as pending ended up rejecting.

When ever I get a error from the server I get this in the development. Not sure what I am doing wrong here.
hydration-error-info.js:63 A query that was dehydrated as pending ended up rejecting. ${QUERY_KEY}: AxiosError: Request failed with status code 500; The error will be redacted in production builds
hydration-error-info.js:63 A query that was dehydrated as pending ended up rejecting. ${QUERY_KEY}: AxiosError: Request failed with status code 500; The error will be redacted in production builds
This is my query
export const useQueryFuncName = ({
interval,
enabled = false,
}: Props) => {
return useQuery({
enabled,
queryKey: [Key],
queryFn: () => {
return func();
},
staleTime: 60 * 60 * 1000 * 4, // 4 hours
});
};
export const useQueryFuncName = ({
interval,
enabled = false,
}: Props) => {
return useQuery({
enabled,
queryKey: [Key],
queryFn: () => {
return func();
},
staleTime: 60 * 60 * 1000 * 4, // 4 hours
});
};
This is the function
const func = async ({ interval }: Props) => {
const { data }: { data: TYPE } = await Api.get(
`/path`,
{
params: { interval },
},
);
return data;
};
const func = async ({ interval }: Props) => {
const { data }: { data: TYPE } = await Api.get(
`/path`,
{
params: { interval },
},
);
return data;
};
And then we proxy to our server.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?