TanStackT
TanStack3mo ago
6 replies
ordinary-sapphire

Dev server hot reload removes one API route

I have a very odd (and very minor) issue that I repeatedly run into. My workflow (using jj-vcs) involves me doing a lot of rebases or other changes to the git log.

Very often I find that when I am running the vite dev server while performing these rebase operations, the automatic route tree generated by TanStack Start/Router (I believe - routeTree.gen.ts) will remove exactly one route from my route tree, until I restart the dev server, at which point it regenerates it back in and the file is once again unchanged.

That route is consistently the one at const ApiElectricRouteImport = createFileRoute('/api/electric')()

I have a maybe slightly complicated route structure in there, which is the only thing I can think of that might be causing it. I'm trying to take advantage of pathless routes here:

> tree src/routes/api/electric 
src/routes/api/electric
└── _session
    ├── activities.ts
    ├── admin
    │   └── _admin
    │       ├── messages.ts
    │       ├── route.ts
    │       ├── trips.ts
    │       └── users.ts
    ├── days.ts
    ├── message-attachments.ts
    ├── message-deltas.ts
    ├── messages.ts
    ├── route.ts
    ├── segments.ts
    └── trips.ts

4 directories, 12 files


Originally posted in the tanstack db section but advised to ask over here.
Was this page helpful?