T
TanStack2y ago
foreign-sapphire

Cannot read properties of undefined (reading 'options')

Hello! I'm using Tanstack router with Vite, and I'm encountering the error Cannot read properties of undefined (reading 'options') after each code change during hmr update.
export const Route = createFileRoute('/_auth/cash-orders/$cashOrderId')({
parseParams: ({ cashOrderId }) => ({
cashOrderId: z.number().int().parse(Number(cashOrderId)),
}),
loader: ({ context: { queryClient }, params: { cashOrderId = -1 } }) =>
queryClient.ensureQueryData(cashOrderQueryOptions(cashOrderId)),
});
export const Route = createFileRoute('/_auth/cash-orders/$cashOrderId')({
parseParams: ({ cashOrderId }) => ({
cashOrderId: z.number().int().parse(Number(cashOrderId)),
}),
loader: ({ context: { queryClient }, params: { cashOrderId = -1 } }) =>
queryClient.ensureQueryData(cashOrderQueryOptions(cashOrderId)),
});
I tried adding stringifyParams, but it didn't help. Is this a bug, or am I doing something wrong? packages: "vite": "^5.1.5", "@tanstack/react-router": "^1.19.1", Attached a screenshot of the error from the Tanstack router.
No description
1 Reply
unwilling-turquoise
unwilling-turquoise2y ago
can you please create a minimal example ?

Did you find this page helpful?