import Fastify from "fastify";
const fastify = Fastify({
logger: {
// Bug in bun
transport: {
target: "pino-pretty",
},
},
});
fastify.get("/", (request, reply) => reply.send("Hello"));
try {
await fastify.listen({ port: 3001 });
console.log("Server listening on port 3001");
} catch (err) {
fastify.log.error(err);
process.exit(1);
}
It only happens when you include this line:
transport: {
target: "pino-pretty",
},
If I comment it, it works fine.
What is the expected behavior?
The expected behavior is for fastify to use pino-pretty when logging into the console.
What do you see instead?
$ bun src/index.ts
Server listening on port 3001
============================================================
Bun Canary v1.1.27-canary.66 (c50f8d82) Windows x64
Windows v.win10_fe
CPU: sse42 avx avx2
Args: "C:\Users\ASUS\.bun\bin\bun.exe" "src/index.ts"
Features: jsc dotenv(2) http_server(2) tsconfig(10)
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:dns" "node:events" "node:fs" "node:http" "node:https" "node:module" "node:os" "node:path" "node:stream" "node:string_decoder" "node:tty" "node:url" "node:util" "node:util/types" "node:worker_threads" "node:diagnostics_channel"
Elapsed: 365ms | User: 46ms | Sys: 31ms
RSS: 0.22GB | Peak: 0.22GB | Commit: 0.29GB | Faults: 53448
panic(thread 19264): Cast 512[handle] -> FDImpl.UV makes closing impossible!
The supplier of this FileDescriptor should call 'bun.toLibUVOwnedFD'
or 'FDImpl.makeLibUVOwned', probably where open() was called.
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.1.27/wa2c50f8d8AioghgC07lnQqplr3C__i8k3yBA0eNo1zbEKwjAURuG9T/E7VUELCq4uloIguFgXcUiaqwne5obcluLbi6LzgfPtjQ7YrjdXb6JjumG1Q1Mf+sRVe0FvnqToWDTEB0KfRDVYpllRnD1Bx5Q4UIbcMfigaAJTTdrlkAbJUC8jO3SGGaUdYzXIMdj2cpoiuaYuC8kof9qH+kdy5RIpizWWX5g8ZYIkivMFJqPfH7nqDZl9QLA
error: script "start" exited with code 3
What version of Bun is running?
1.1.27
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
This is my code
It only happens when you include this line:
If I comment it, it works fine.
What is the expected behavior?
The expected behavior is for fastify to use pino-pretty when logging into the console.
What do you see instead?
Additional information
No response