You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above should print status 302. Running the same sample with bun rundoes print status 302.
What do you see instead?
Error TypeError: Failed to parse URL from /home
at Response.redirect (node:internal/deps/undici/undici:9100:17)
at redirect (file:///Users/eli/code/elysia-node-redirect-issue/node_modules/elysia/dist/utils.mjs:1037:50)
... 4 lines matching cause stack trace ...
at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) {
[cause]: TypeError: Invalid URL
at new URL (node:internal/url:818:25)
at Response.redirect (node:internal/deps/undici/undici:9098:23)
at redirect (file:///Users/eli/code/elysia-node-redirect-issue/node_modules/elysia/dist/utils.mjs:1037:50)
at Array.<anonymous> (/Users/eli/code/elysia-node-redirect-issue/tests/redirect-invalid-status-code.ts:15:14)
at Server.map (eval at composeGeneralHandler (file:///Users/eli/code/elysia-node-redirect-issue/node_modules/elysia/dist/compose.mjs:1330:10), <anonymous>:22:43)
at Server.emit (node:events:507:28)
at parserOnIncoming (node:_http_server:1153:12)
at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) {
code: 'ERR_INVALID_URL',
input: '/home'
}
}
Waiting for the debugger to disconnect...
node:_http_server:358
throw new ERR_HTTP_INVALID_STATUS_CODE(originalStatusCode);
^
RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
at ServerResponse.writeHead (node:_http_server:358:11)
at Elysia.eval [as handleError] (eval at composeErrorHandler (file:///Users/eli/code/elysia-node-redirect-issue/node_modules/elysia/dist/compose.mjs:1435:10), <anonymous>:24:5)
at Server.map (eval at composeGeneralHandler (file:///Users/eli/code/elysia-node-redirect-issue/node_modules/elysia/dist/compose.mjs:1330:10), <anonymous>:24:26)
at Server.emit (node:events:507:28)
at parserOnIncoming (node:_http_server:1153:12)
at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17) {
code: 'ERR_HTTP_INVALID_STATUS_CODE'
}
Node.js v23.6.1
What version of Elysia is running?
1.2.10
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
Run the following:
What is the expected behavior?
The above should print
status 302
. Running the same sample withbun run
does printstatus 302
.What do you see instead?
Additional information
Additionally, running the following simply hangs:
Running the above using
bun run
printsstatus 302
.Have you try removing the
node_modules
andbun.lockb
and try again yet?yes
The text was updated successfully, but these errors were encountered: