Skip to content

Start: Tanstack Start + Code Based Routing not working #5808

@gabenddos

Description

@gabenddos

Which project does this relate to?

Start

Describe the bug

I'm trying to setup code based routing with tanstack start but I always fallback in two errors:
"Crawling result not available" or "Could not load tanstack-start-manifest:v".

Here is the stackblitz of a minimal tanstack start CLI + code based routing
https://stackblitz.com/~/github.com/gabenddos/tanstack-start-code-based-router?file=vite.config.ts

Github Public Repo:
https://github.com/gabenddos/tanstack-start-code-based-router/

During the cli I'm enabled tailwind, biomejs, compiler, query, form and table, shadcn.

  1. Could not load tanstack-start-manifest:v:
    The project runs for dev but won't build. I already tried to run with and without nitro, and everytime the client passes but the server build instantly crashes.
error during build:
[tanstack-start:start-manifest-plugin] Could not load tanstack-start-manifest:v (imported by node_modules/.pnpm/@tanstack+start-server-core@1.134.20/node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js): Cannot read properties of undefined (reading 'routes')
    at Object.handler (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/@tanstack+start-plugin-core@1.135.0_@tanstack+react-router@1.135.0_react-dom@19.2.0_rea_c62dc329acdd0f709ac914e0d3f16db7/node_modules/@tanstack/start-plugin-core/dist/esm/start-manifest-plugin/plugin.js:74:66)
    at Object.handler (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/vite@7.2.2_@types+node@22.19.0_jiti@2.6.1_lightningcss@1.30.2_tsx@4.20.6/node_modules/vite/dist/node/chunks/config.js:34337:13)
    at file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/rollup@4.53.2/node_modules/rollup/dist/es/shared/node-entry.js:22437:40
    at async PluginDriver.hookFirstAndGetPlugin (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/rollup@4.53.2/node_modules/rollup/dist/es/shared/node-entry.js:22319:28)
    at async file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/rollup@4.53.2/node_modules/rollup/dist/es/shared/node-entry.js:21319:33
    at async Queue.work (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/rollup@4.53.2/node_modules/rollup/dist/es/shared/node-entry.js:22547:32)
 ELIFECYCLE  Command failed with exit code 1.
  1. Crawling result not available:
    Don't build and also runs on dev you can se the page being rendered behind the error overlay (same error as build).
2:03:13 PM [vite] (client) Pre-transform error: Crawling result not available
2:03:13 PM [vite] Internal server error: Crawling result not available
      at LoadPluginContext.handler (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/@tanstack+start-plugin-core@1.135.0_@tanstack+react-router@1.135.0_react-dom@19.2.0_rea_c62dc329acdd0f709ac914e0d3f16db7/node_modules/@tanstack/start-plugin-core/dist/esm/start-router-plugin/plugin.js:140:17)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async EnvironmentPluginContainer.load (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/vite@7.2.2_@types+node@22.19.0_jiti@2.6.1_lightningcss@1.30.2_tsx@4.20.6/node_modules/vite/dist/node/chunks/config.js:29378:19)
      at async loadAndTransform (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/vite@7.2.2_@types+node@22.19.0_jiti@2.6.1_lightningcss@1.30.2_tsx@4.20.6/node_modules/vite/dist/node/chunks/config.js:23245:21)
      at async viteTransformMiddleware (file:///Users/gaben/Development/code-based-tanstack-start/node_modules/.pnpm/vite@7.2.2_@types+node@22.19.0_jiti@2.6.1_lightningcss@1.30.2_tsx@4.20.6/node_modules/vite/dist/node/chunks/config.js:25159:20)

Your Example Website or App

https://stackblitz.com/~/github.com/gabenddos/tanstack-start-code-based-router?file=vite.config.ts

Steps to Reproduce the Bug or Issue

  1. Create a basic tanstack start app via CLI
  2. Manually code your routeTree.ts following the tanstack router official docs.
import { RootRoute } from "./routes/__root";
import { homeRoute } from "./routes/home-route";

export const routeTree = RootRoute.addChildren([homeRoute]);

  1. Add a dummy / route for tests e.g. home-route
  2. In vite.config.ts config on the plugin inicialization, add this config on the tanstackStart plugin:
 tanstackStart({
      router: {
        enableRouteGeneration: false,
        generatedRouteTree: "./routeTree.ts",
      }
    }),

Expected behavior

The project should be able to build

Screenshots or Videos

No response

Platform

  • Router / Start Version: ^1.132.0
  • OS: macOS
  • Browser: Chrome
  • Browser Version: 142.0.7444.60
  • Bundler: Vite
  • Bundler Version: ^7.1.7

Additional context

I have a more complex turbo repo that this problem of build was hapening (I though it was related to the turbo setup) but then when I used the CLI to create a new one from scratch and just by changing from file to code based routing it start to give the same error I realized it would be something related with the code base routing implementation.

I'm two full days deep into this already, please help, I really want to implement this architecture that I've been building in the last week for the company I work for. I think tanstack start is a must for the future of react, NextJS just sucks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions