npx tsr generate wants to delete hundreds of files instead of generating TanStack routes
TanStackConfirmed fix
@tanstack/router-plugin (Vite)
There is no error message for this one, only the symptom in the title.
Cause
tsr resolves to an unrelated dead-code remover package (ts-remove-unused), not TanStack's router CLI, because both ship a tsr bin.
Fix
Call the package explicitly, matching your router version:
shell
npx --yes @tanstack/router-cli@<version> generateAlso compare the result against the plugin-generated routeTree.gen.ts before committing: the CLI output can drop directory index routes.