-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Which project does this relate to?
Start
Describe the bug
Redirects with Server Route handlers (API routes) are not working in development when using the Nitro v3 (nitro-nightly) plugin. This is also probably breaking OAuth flows as they typically involve a couple redirects.
Only in development. I tested with a local Node.js build and Vercel deployment and it works fine.
Not sure if this is a Start issue or just with Nitro.
Your Example Website or App
https://github.com/dotnize/ts-start-nitrov3-response-utils
Steps to Reproduce the Bug or Issue
- Run app in dev
- Go to
/api/testor/api/test2- error will show
Expected behavior
Redirect to specified url in development
Screenshots or Videos
ℹ HTTPError: fetch failed
⁃ (node:internal/deps/undici/undici:13510:13)
⁃ at processTicksAndRejections (node:internal/process/task_queues:105:5)
⁃ at fetchHandler (node_modules/.pnpm/nitro-nightly@3.0.0-20250924-113752-9fe8cd46_vite@7.1.7_@types+node@22.18.6_jiti@2.6.0__f3fc809ec029dafbeaa607130fd159a4/node_modules/nitro-nightly/dist/runtime/internal/app.mjs:52:22)
47 ┃ const event = { req };
48 ┃ const nitroApp = useNitroApp();
49 ┃ await nitroApp.hooks.callHook("request", event).catch((error) => {
50 ┃ captureError(error, { event, tags: ["request"] });
51 ┃ });
❯ 52 ┃ const response = await h3App.request(req, void 0, req.context);
53 ┃ await nitroApp.hooks.callHook("response", response, event).catch((error) => {
54 ┃ captureError(error, { event, tags: ["request", "response"] });
55 ┃ });
56 ┃ return response;
57 ┃ };
⁃ (node_modules/.pnpm/nitro-nightly@3.0.0-20250924-113752-9fe8cd46_vite@7.1.7_@types+node@22.18.6_jiti@2.6.0__f3fc809ec029dafbeaa607130fd159a4/node_modules/nitro-nightly/dist/runtime/internal/vite/worker.mjs:88:16)
[CAUSE]
TypeError {
stack: 'fetch failed\n' +
' at node:internal/deps/undici/undici:13510:13\n' +
' at processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
'at fetchHandler (./node_modules/.pnpm/nitro-nightly@3.0.0-20250924-113752-9fe8cd46_vite@7.1.7_@types+node@22.18.6_jiti@2.6.0__f3fc809ec029dafbeaa607130fd159a4/node_modules/nitro-nightly/dist/runtime/internal/app.mjs:52:22)\n' +
'at ./node_modules/.pnpm/nitro-nightly@3.0.0-20250924-113752-9fe8cd46_vite@7.1.7_@types+node@22.18.6_jiti@2.6.0__f3fc809ec029dafbeaa607130fd159a4/node_modules/nitro-nightly/dist/runtime/internal/vite/worker.mjs:88:16)',
message: 'fetch failed',
cause: Error {
stack: 'C0963F55217F0000:error:0A0000C6:SSL routines:tls_get_more_records:packet length too long:../deps/openssl/openssl/ssl/record/methods/tls_common.c:662:\n' +
'\n' +
'at Error: C0963F55217F0000:error:0A0000C6:SSL routines:tls_get_more_records:packet length too long:../deps/openssl/openssl/ssl/record/methods/tls_common.c:662::undefined:undefined)',
message: 'C0963F55217F0000:error:0A0000C6:SSL
routines:tls_get_more_records:packet length too
long:../deps/openssl/openssl/ssl/record/methods/tls_common.c:662:\n',
library: 'SSL routines',
reason: 'packet length too long',
code: 'ERR_SSL_PACKET_LENGTH_TOO_LONG',
},
}
Platform
- Router / Start Version: 1.132.6
- OS: Linux
- Browser: Chrome 140
- Bundler: Vite 7.1.7
- Node version: 22.20.0
Additional context
setResponseHeader("Location", "https://tanstack.com");
return new Response(null, { status: 302 });return Response.redirect("https://tanstack.com");package.json
"nitro": "npm:nitro-nightly@latest",vite config
+ import { nitro } from 'nitro/vite'
export default defineConfig({
server: {
port: 3000,
},
plugins: [
tsConfigPaths(),
tanstackStart(),
+ nitro(),MarkForLoop, incpo, sebastiangraz, brhx, Enalmada and 9 more