Closed sirenkovladd closed 4 months ago
@Jarred-Sumner, is it possible to apply this PR because it blocks the use of fastify-cli
?
330 | family: isIPv6(address) ? "IPv6" : "IPv4",
331 | port: this.#server.port
332 | };
333 | }
334 |
335 | listen(port, host, backlog, onListen) {
^
error: Failed to start server. Is port 3000 in use?
at listen (node:http:335:16)
at <cut>/node_modules/fastify/lib/server.js:234:6
at <cut>/node_modules/fastify/lib/server.js:189:10
at node:dns:11:70
So it's a workaround
Yeah, fastify doesn't work with bun yet.
Yeah, fastify doesn't work with bun yet.
Bun is working with Fastify on the canary release, including with TypeORM. Only issues I've had is related to NAPI libraries, such as node-canvas/canvas. This is with NestJS.
bun upgrade --canary
// TS:
bun add -d bun-types@canary
This bug was fixed in Bun 1.0
/tmp/checky
❯ bun such-work.js
{"address":"::1","family":"IPv6","port":3000}
/tmp/checky
❯ node such-work.js
{"address":"::1","family":"IPv6","port":3000}
/tmp/checky
❯ cat such-work.js
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: such-work.js
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ const server = require("http").createServer();
2 │ server.listen(3000, "localhost", () => {
3 │ console.log(JSON.stringify(server.address()));
4 │ process.exit(0);
5 │ });
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
What version of Bun is running?
0.8.1+16b4bf341acc0f4804f0b6bdf5298c180cd00366
What platform is your computer?
Linux 6.2.0-26-generic x86_64 x86_64
What steps can reproduce the bug?
What is the expected behavior?
What do you see instead?
Additional information
(http.Server instanceof net.Server)
https://github.com/nodejs/node/blob/v20.5.1/lib/net.js#L2004
https://github.com/nodejs/node/blob/v20.5.1/lib/net.js#L2062-L2073