Hi all,
I’m running into an issue with TanStack Router’s file-based routing. My file structure is:
src/routes/
_authenticated.tsx
_authenticated.create-log.tsx
_authenticated.index.tsx
In _authenticated.create-log.tsx, I set up the route like this:
export const Route = createFileRoute('/_authenticated/create-log')({
// code here
})
But whenever I save the file, the path in createFileRoute automatically changes to:
createFileRoute('/create-log')
This causes a TypeScript error:
Argument of type '"/create-log"' is not assignable to parameter of type 'keyof FileRoutesByPath | undefined'.
It seems like some tool or extension is auto-correcting the route path and removing the _authenticated part, even though I want to keep the file path for type safety.
Has anyone else run into this? Is there a way to prevent this auto-correction or configure it to keep the full file path?
Thanks!