Is it possible to have a route with __ in the path?
I need to handle requests to ${baseroute}/__/auth/handler. I'm using the file based routing approach and createFileRoute. I haven't found a way to create a file that doesn't fail due to the leading underscore being trimmed.
I included more details in the SO post:
https://stackoverflow.com/questions/79093101/when-using-tanstack-routers-file-based-routing-and-createfileroute-how-can-i-g
Stack Overflow
When using TanStack Router's file based routing and createFileRoute...
My auth flow dictates that I handle a callback at ${baseURL}//auth/handler.
I'm having difficulty working around the createFileRoute function.
At first I tried placing the page at /auth/handler...
4 Replies
exotic-emerald•11mo ago
no, using the file based convention this is not possible. a route with a leading underscore is treated as a pathless route.
however, you can use virtual file routes.
https://tanstack.com/router/v1/docs/framework/react/guide/virtual-file-routes
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

exotic-emerald•11mo ago
you can also mix this with the standard file based routing, if you just want to bail out of the convention for this particular route
exotic-emerald•11mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

ambitious-aquaOP•11mo ago
Cool! Thanks. I’ll look into that.