TanStackT
TanStack12mo ago
1 reply
awake-maroon

Redirect to throws type error on dynamic route

I have a dynamic route setup and the types keep throwing me errors even tho the route is clearly there.

export const Route = createFileRoute("/doc/$exportId")({
  loader: async ({ params: { exportId } }) => {
    redirect({
      to: `/file/externalName/${exportId}`,
      throw: true,
    })
  },
})

The "to" keeps yelling at me that it is not a valid route, even tho I have "$sourceExternalName.$exportId.tsx" in my routes/file. Any idea why this could be?
Was this page helpful?