I have encountered the same problem. The issue is you missing routeTree.gen.ts file under src/. Although it should be auto generated, according to the docs it does not happen in some instances. The steps to solving this issue are:
Download the tanstack router cli:
npm install --save-dev @tanstack/router-cli
Create tsr.config.json in your project root, example:
{ "$schema": "https://cdn.jsdelivr.net/npm/@tanstack/router-cli/schema.json", "routesDirectory": "./src/routes", "generatedRouteTree": "./src/routeTree.gen.ts", "routeFileIgnorePattern": "\.(test|spec)\.[jt]sx?$" }
Create a script in package.json and run it: "scripts": { "generate:routes": "tsr generate" }
This will create the required file according to your routes directory.