bun
bun copied to clipboard
Maximum url length (or header size) is different from Node's default
What version of Bun is running?
1.1.2
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
- Launch fastify + tRPC server on Bun
- Access to the server via tRPC client with batch which generates a very long url (the url length is more than 8000)
- Like
await Promise.all([<long array>].map(param => trpcClient.xxx.query({ param })));
- Like
- An error occurs due to
cause: SocketError: other side closed- If we use
maxURLLength: 8000in the options of tRPC Client, then the error doesn't occur.
- If we use
What is the expected behavior?
An error should not occur on the step 3.
What do you see instead?
TRPCClientError: fetch failed
at TRPCClientError.from (file:///Users/exkazuu/xxx/node_modules/@trpc/client/dist/TRPCClientError-38f9a32a.mjs:38:16)
at file:///Users/exkazuu/xxx/node_modules/@trpc/client/dist/httpUtils-b9d0cb48.mjs:128:36 {
meta: {},
shape: undefined,
data: undefined,
[cause]: TypeError: fetch failed
at node:internal/deps/undici/undici:12618:11 {
cause: SocketError: other side closed
at Socket.onSocketEnd (node:internal/deps/undici/undici:9169:26)
at Socket.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'UND_ERR_SOCKET',
socket: [Object]
}
}
}
Additional information
We don't use --max-http-header-size option in Node.js.
We also need to make the error message better.