Skip to content

Monorepo only: Routes starting with "_" always 404 (eg. /_hello) #6242

Closed

Description

@oztune

Which project does this relate to?

Start

Describe the bug

Note

This one was a doozy to recreate because it only happens when the Tanstack Start app is inside of a monorepo.

I need to create the route http://localhost:3000/_hello. I have the following setup:

my-monorepo/
  packages/
    [...]
  apps/
    my-app
      src/
        routes/
          __root.tsx
          [_]hello.tsx

Where [_]hello.tsx looks like this:

import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_hello')({
	server: {
		handlers: {
			GET: async () => {
				return Response.json({ hello: 'world' })
			},
		},
	},
})

But when I visit http://localhost:3000/_hello I get a 404 page.


When I create a fresh Tanstack Start app this problem goes away. But as soon as I place it inside of a monorepo it comes back. I only tested this with a pnpm monorepo.

Your Example Website or App

https://github.com/oztune/tanstack-start-bug

Steps to Reproduce the Bug or Issue

  1. Set up a monorepo (doesn't happen in a single repo). I tested this with a pnpm monorepo.
  2. Create a fresh Tanstack Start project from template
  3. Create any route that start with an escaped underscore [_]anything.tsx
  4. Visit that route in the browser (http://localhost:3000/_anything)
  5. You always get 404

Expected behavior

I expect http://localhost:3000/_anything to serve the route

Screenshots or Videos

No response

Platform

MacOS 15.6.1
Any browser

"@tanstack/react-devtools": "^0.7.0",
"@tanstack/react-router": "^1.141.8",
"@tanstack/react-router-devtools": "^1.141.8",
"@tanstack/react-router-ssr-query": "^1.141.8",
"@tanstack/react-start": "^1.141.8",
"@tanstack/router-plugin": "^1.141.8",
"@tanstack/zod-adapter": "^1.142.8",
"nitro": "latest",
"react": "^19.2.1",
"react-dom": "^19.2.1",
"vite-tsconfig-paths": "^5.1.4",
"zod": "^4.2.1"

Additional context

No response

Activity

  1. coderabbitai commented on Dec 29, 2025

    @coderabbitai
    Contributor

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    Examples

    🔗 Similar Issues

    Possible Duplicates

    Related Issues

    🔗 Related PRs

    #5647 - test(solid-start): fix dev server for suspense transition [merged]
    #5650 - fix: fix static server functions [merged]
    #5686 - fix(router-core): Catch errors thrown during hydrate [merged]
    #5847 - docs(solid-start): start-large example [merged]
    #5849 - docs(solid-start): start-tailwind-v4 [merged]

    👤 Suggested Assignees

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. schiller-manuel commented on Dec 30, 2025

    @schiller-manuel
    Collaborator

    you are using an old version of the generator. please update to latest which fixes this issue

  3. oztune commented on Dec 30, 2025

    @oztune
    Author

    Thanks @schiller-manuel! for me own understanding, which of those packages contain the generator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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