TanStackT
TanStack4w ago
95 replies
radical-lime

Infinite loop once deployed

I have two routes that causes infinite loop if I directly go to the URL in production. In dev it works. We have deployed with SST(nitro):
// both these are affected
// Route 1
const CombinedSearchSchema = FilterStateSchema.extend({
  shiftId: z.string().optional().catch(undefined),
  // controls worker details dialog open + which worker
  workerId: z.string().optional().catch(undefined),
});

export const Route = createFileRoute("/app/(company)/company/$id/jobs-dashboard/$jobId/candidates")({
  component: RouteComponent,
  ssr: false,
  validateSearch: (search) => CombinedSearchSchema.parse(search),
});


// Route 2
const CombinedSearchSchema = FilterStateSchema.extend({
  shiftId: z.string().optional().catch(undefined),
});

export const Route = createFileRoute("/app/(company)/company/$id/jobs-dashboard/$jobId/selected")({
  component: RouteComponent,
  ssr: false,
  validateSearch: (search) => CombinedSearchSchema.parse(search),
});
// This is the CombinedSearchSchema btw:


Its causing 307 infinite loop if I directly visit one of the paths with my browser. (f.ex: https://mydomain.com/app/company/xx-xx-xx-a567-xxxx/jobs-dashboard/xx-xx-xx-aa5c-xxx/selected)

Any idea how I can debug this?
Was this page helpful?