T
TanStack2mo ago
harsh-harlequin

request.headers.get is not a function

After updating to stable V1, got this error on my server with docker node:24-alpine: TypeError: request.headers.get is not a function at getOrigin (file:///usr/server/node_modules/@tanstack/router-core/dist/esm/ssr/ssr-server.js:109:40) ... 8 lines matching cause stack trace ... at Object.handler (file:///usr/server/chunks/nitro/nitro.mjs:1558:31) { cause: TypeError: request.headers.get is not a function at getOrigin (file:///usr/server/node_modules/@tanstack/router-core/dist/esm/ssr/ssr-server.js:109:40) at startRequestResolver (file:///usr/server/chunks/virtual/entry.mjs:1672:20) at file:///usr/server/chunks/virtual/entry.mjs:1279:13 at AsyncLocalStorage.run (node:internal/async_local_storage/async_context_frame:63:14) at Object.fetch (file:///usr/server/chunks/virtual/entry.mjs:1277:35) at fetch (file:///usr/server/chunks/virtual/entry.mjs:2132:21) at Object._webHandler [as handler] (file:///usr/server/chunks/virtual/entry.mjs:19:10) at Object.handler (file:///usr/server/chunks/nitro/nitro.mjs:1487:24) at Object.handler (file:///usr/server/chunks/nitro/nitro.mjs:1797:34) at Object.handler (file:///usr/server/chunks/nitro/nitro.mjs:1558:31), status: 500, statusText: undefined, headers: undefined, data: undefined, body: undefined, unhandled: true } Any ideas? @tanstack/react-start@1.132.48 @tanstack/react-router@1.132.47 Using npm
6 Replies
harsh-harlequin
harsh-harlequin2mo ago
node .output/server/index.mjs

Listening on http://[::]:3000
[h3] Implicit event handler conversion is deprecated. Use `eventHandler()` or `fromNodeMiddleware()` to define event handlers.
Handler: function _webHandler(event) {
return handler(event.req, event.context);
}
TypeError: request.headers.get is not a function
node .output/server/index.mjs

Listening on http://[::]:3000
[h3] Implicit event handler conversion is deprecated. Use `eventHandler()` or `fromNodeMiddleware()` to define event handlers.
Handler: function _webHandler(event) {
return handler(event.req, event.context);
}
TypeError: request.headers.get is not a function
I get this error with nitrov2 plugin. I don't use the "request.headers.get" anywhere in my codebase. Did you find a solution to it?
modern-teal
modern-teal2mo ago
this issues comes when you have some mixup of packages installed can be caused by the package manager. which one are you using? make sure to also only have nitro V2 Plugin installed without the v3 Version
harsh-harlequin
harsh-harlequin2mo ago
Thats interesting. I was experimenting with both so I have both installed. Tried both bun and npm. Gonna try to remove v3 and see if v2 works and vice versa. Okay that (removing v3) solved the issue for nitro v2. Got another issue now so I'll get back if I cant solve that too.
modern-teal
modern-teal2mo ago
pnpm btw works much better as it isolates packages
harsh-harlequin
harsh-harlequin2mo ago
Cool thats good to know. I would prefer to use bun really but since it doesnt support HTTP2 with Bun Serve I am looking into nitro now. Perhaps switching to pnpm later then too
modern-teal
modern-teal2mo ago
bun with isolated installs is also working

Did you find this page helpful?