TanStackT
TanStack2y ago
1 reply
skinny-azure

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)),
});


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.
image.png
Was this page helpful?