Closed kran6a closed 2 months ago
minimal reproduce
const http = require("http");
const server = http.Server((req, res) => {
setTimeout(() => {
console.log(req.read()?.toString());
res.end()
})
}).listen(0, async () => {
const req = http.request({ port: server.address().port, method: 'POST' }, () => server.close());
req.write('test message');
req.end();
})
❯ bun reproduce.cjs
undefined
❯ node reproduce.cjs
test message
It already works, closing.
What version of Bun is running?
1.1.8+89d25807f
What platform is your computer?
Linux 5.15.146.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
What is the expected behavior?
The same as when index.ts is executed with ts-node.
ts-node index.ts
bun client.ts
console logs
Hello Kranga
on the clientWhat do you see instead?
bun index.ts
bun client.s
An error is thrown:
Apparently it has to do with streams since it seems the request body is empty when trpc attempts to read it.
Additional information
No response