nitro icon indicating copy to clipboard operation
nitro copied to clipboard

Bun preset doesn't work for TanStack Start `createFileRoute` $ API endpoints

Open jonasfroeller opened this issue 1 month ago • 1 comments

Environment

Dynamic API endpoints created using createFileRoute in TanStack Start are not being registered when using the Bun preset. All API route requests return 404 errors instead of executing the defined handlers.

Reproduction

  1. Make a $ route: Image

example:

import { createFileRoute } from '@tanstack/react-router'
import { reactStartHandler } from '@convex-dev/better-auth/react-start'

export const Route = createFileRoute('/api/auth/$')({
  server: {
    handlers: {
      GET: ({ request }) => {
        return reactStartHandler(request)
      },
      POST: ({ request }) => {
        return reactStartHandler(request)
      },
    },
  },
})
  1. Build using preset:
plugins.push(nitro({ preset: 'bun' }))

Describe the bug

All API route requests return 404 errors instead of executing the defined handlers.

Additional context

"nitro": "3.0.1-alpha.1",
bun --version
1.3.2

Logs

none

Image

jonasfroeller avatar Nov 20 '25 01:11 jonasfroeller

Appreciate if you can share a runnable minimal tanstack+nitro reproduction (no other deps)

pi0 avatar Nov 20 '25 09:11 pi0