Troubleshoot Tanstack routeTree.gen Generator

In this lesson, we learn how to troubleshoot issues with TanStack Router's automatic generation of the routeTree.gen.ts file.

If the file is not being updated or new routes are not being recognized, the most common cause is that the development server is not running. As a rule of thumb, start the dev server - this resolves the issue, allowing the routeTree.gen.ts file to be properly generated and updated with new routes. This ensures that all routes are correctly registered and type-safe routing features function as expected.

Share with a coworker

Transcript

[00:00] If you ever find yourself in a situation where you create a new root, so here we've got a project.dsx file, and there is essentially nothing going on, so there is no automatically generated code, and not only this, but also inside the root tree again, there is no new imported root, then most probably the reason is that essentially your development server is not running. So after we run the server and it's running then we would see that first project file has been filled with the default content, but also the root tree again has been improved with the new code. So make sure your dev server is running.