nitro
nitro copied to clipboard
Bun preset doesn't work for TanStack Start `createFileRoute` $ API endpoints
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
- Make a $ route:
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)
},
},
},
})
- 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
Appreciate if you can share a runnable minimal tanstack+nitro reproduction (no other deps)