bun
bun copied to clipboard
!!When packaging, the undefined type is compiled into the undefined of the string.
What version of Bun is running?
1.1.2+c8d072c2a
What platform is your computer?
Linux 5.15.0-101-generic x86_64 x86_64
What steps can reproduce the bug?
build.ts
await Bun.build({
entrypoints: ["./src/index.ts"],
outdir: "./build",
target: "bun",
format: "esm",
sourcemap: "inline",
minify: true,
});
console.log("Build success!");
export {};
When a strange situation occurs after execution
Query: select `id`, `username`, `email`, `phone`, `role`, `create_time`, `update_time` from (select `id`, `username`, `email`, `phone`, `role`, `create_time`, `update_time` from `users` where (`users`.`username` like ? and `users`.`email` like ? and `users`.`phone` like ? and `users`.`role` like ?)) `userList` limit ? -- params: ["%undefined%", "%undefined%", "%undefined%", "%undefined%", 10]
All my parameters have become undefined.
What is the expected behavior?
Query: select `id`, `username`, `email`, `phone`, `role`, `create_time`, `update_time` from (select `id`, `username`, `email`, `phone`, `role`, `create_time`, `update_time` from `users`) `userList` limit ? -- params: [10]
What do you see instead?
No response
Additional information
No response
#9994 Reprodicating the code is to remove --minify
and execute it after packaging it.