In-server fetch to dev routes not working
Open
Nobody has claimed this yet.
bug
v2
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Environment
Nitro version: 2.13.1
Node version: 20.19.1
import { defineEventHandler } from 'h3';
export default defineNitroConfig({
compatibilityDate: '2025-03-01',
srcDir: 'server',
devHandlers: [
{
route: '/devTest',
handler: defineEventHandler((event) => {
return 'dev test response';
}),
},
],
});
Reproduction
Minimal reproduction in stackblitz
- Define dev route in the nitro config.
- Verify that the route is working when called directly.
- Define normal route that calls the dev route -> Fails with error.
Describe the bug
The dev routes are not reachable from the normal routes. More info in the original issue I opened on nuxt repo.
Additional context
No response
Logs
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 nitro.config.ts setup and reproduce the behavior using the linked StackBlitz example, comparing direct requests to /devTest with requests made from a normal route. Trace how devHandlers are reached during in-server fetches; done means the normal route can reach /devTest as well as a direct request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100