Bun preset doesn't work for TanStack Start `createFileRoute` $ API endpoints
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduced createFileRoute('/api/auth/$') example and the Nitro configuration using preset: 'bun'. Build the application with Nitro 3.0.1-alpha.1 and Bun 1.3.2, then inspect why requests to the dynamic API endpoint return 404 instead of invoking the declared GET and POST handlers. Done means those handlers are registered and API requests no longer return 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bun, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100