Bun throws different errors when using DNS functions
22 posts since May 2025, all from GitHub.
“What version of Bun is running? 1.4.4+38afee6c8 (also seen on 1.4.2) What platform is your computer? macOS arm64 (also seen on Linux x64) What steps can reproduce the bug? 20251104. domainkey.google.com is one TXT record made of two character strings, 255 and 155 bytes long: The…”
“What happens Errors from DNS resolution have no stack property, unlike other errors in Bun and unlike Node's DNS errors. The same DNSException without a stack is emitted as the error event of net.connect(port, unresolvableHost) . Expected e.stack is a string, as for other Error…”
“What version of Bun is running? 1.4.4 (also 1.4.3) What platform is your operating system? macOS (arm64) for the repro below; the same behavior appears on Linux arm64 in production containers. What steps can reproduce the bug? repro.mjs has no dependencies and runs unchanged in…”
Bun is producing different error codes and messages compared to Node.js when utilizing DNS functions like `dns.lookup`, `dns.reverse`, and encountering connection refused errors.
SOURCES (22)
“What version of Bun is running? 1.4.4+38afee6c8 (also seen on 1.4.2) What platform is your computer? macOS arm64 (also seen on Linux x64) What steps can reproduce the bug? 20251104. domainkey.google.com is one TXT record made of two character strings, 255 and 155 bytes long:…”
“What happens Errors from DNS resolution have no stack property, unlike other errors in Bun and unlike Node's DNS errors. The same DNSException without a stack is emitted as the error event of net.connect(port, unresolvableHost) . Expected e.stack is a string, as for other Error instances ( e instanceof Error is true ) and as in Node. Why it matters Libraries reasonably call error.stack.split(...) . postgres.js 4.x does this in its connection error path, which throws and leaves queries pending fo”
“What version of Bun is running? 1.4.4 (also 1.4.3) What platform is your operating system? macOS (arm64) for the repro below; the same behavior appears on Linux arm64 in production containers. What steps can reproduce the bug? repro.mjs has no dependencies and runs unchanged in Node and Bun. It starts a tiny authoritative DNS server on 127.0.0.1 that answers A with one record and AAAA with NODATA ( NOERROR , empty answer section), then queries both types through a dns.Resolver pointed at it. <de”
“What version of Bun is running? bun revision on the unpatched release: This is the latest stable release as of October 29, 2026. Node.js comparison: v26.10.0. Canary has not been tested. What platform is your computer? uname mprs : Linux was tested in Ubuntu 24.04 on Docker Desktop. What steps can reproduce the bug? Save as repro.mjs : Run the same file with both runtimes: The generated parent directories do not exist; the final basename is always s.sock . Each line prints the path length in byt”
“What version of Bun is running? Also reproduced on 1.4.4 canary.1+5c6d4e24c . Newer canaries were not tested. What platform is your computer? What steps can reproduce the bug? Run Bun under the name node : either through the bun run shim when Node is not on PATH , or with a copy of the binary named node ( node.exe on Windows). The same through bun run , with Node absent from PATH : What is the expected behavior? Node v26.7.0 reads the program from stdin in each form (stdin is not a TTY) and prin”
“What version of Bun is running? 1.4.3+c6da4a4d3 ( bun revision . 1.4.3 is the latest release, 2026 10 10. Canary was not tested.) What platform is your computer? Linux 7.2.9 (WSL2, x86 64) What steps can reproduce the bug? Parse one URL, then read its properties in a loop. Save as repro.mjs , run it with node repro.mjs and with bun repro.mjs , alternating the two runtimes and flipping which goes first on each round: What is the expected behavior? Reading a property of a URL that is already parse”
“What version of Bun is running? No response What platform is your computer? No response What steps can reproduce the bug? export BUN OPTIONS= dns result order=ipv4first export NODE OPTIONS= dns result order=ipv4first bun publish What is the expected behavior? use the IP4 address for npmjs.com What do you see instead? It alternates between IP4 and IP6 and which means it will not remember an IP address for 5 minutes when asked (it will not remember two), so you have to enter a OTP code each time a”
“What version of Bun is running? The npm latest dist tag points to 1.4.2 at the time of this report. Node.js v22.23.2 was used for comparison. What platform is your computer? What steps can reproduce the bug? Destroying a custom Duplex used as the transport for a server side tls.TLSSocket closes and destroys the wrapping TLS socket in Node.js. In Bun 1.4.2, the TLS socket remains undestroyed and does not emit close during the reproduction. Save this as lifecycle.cjs : Run the exact same file with”
“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux 6.8.0 136 generic x86 64 x86 64 What steps can reproduce the bug? What is the expected behavior? Node.js prints: What do you see instead? Bun throws: Additional information No response”
“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux 6.8.0 136 generic x86 64 x86 64 What steps can reproduce the bug? What is the expected behavior? Node.js throws: What do you see instead? Bun prints: Additional information No response”
“What version of Bun is running? Linux 6.8.0 136 generic x86 64 x86 64 What platform is your computer? Linux 6.8.0 136 generic x86 64 x86 64 What steps can reproduce the bug? What is the expected behavior? Node.js prints: What do you see instead? Bun prints: Additional information No response”
“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux 6.8.0 136 generic x86 64 x86 64 What steps can reproduce the bug? What is the expected behavior? Node.js throws: What do you see instead? Bun does not print or throw anything. Additional information No response”
“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux 6.8.0 136 generic x86 64 x86 64 What steps can reproduce the bug? What is the expected behavior? Node.js prints: What do you see instead? Bun print and then throws: Additional information No response”
“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux 6.8.0 136 generic x86 64 x86 64 What steps can reproduce the bug? What is the expected behavior? Node.js does not print anything. What do you see instead? Bun throws: Additional information No response”
“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux bombe mint 6.8.0 136 generic 136 Ubuntu SMP PREEMPT DYNAMIC Wed Jul 1 21:53:05 UTC 2026 x86 64 x86 64 x86 64 GNU/Linux What steps can reproduce the bug? What is the expected behavior? Node.js throws: What do you see instead? Bun throws: Additional information No response”
“What version of Bun is running? 1.4.0 canary.1+f68e504ae (also reproduced on 1.3.14 ) What platform is your computer? Linux x64 What steps can reproduce the bug? What is the expected behavior? What do you see instead? Additional information Bun resolves utils.d.mts as a runtime module (not just a type declaration). The file's last line is: TypeScript valid but JavaScript invalid syntax for mixed type/value re exports. Bun's ESM parser rejects it with SyntaxError . This breaks any package that sh”
“What version of Bun is running? 1.4.0 canary.1+bcad9b220 What platform is your computer? Linux 6.12.86+deb13 amd64 x86 64 x86 64 What steps can reproduce the bug? Hi, I would like to report a behavior in Bun that can be reproduced using the below snippet: What is the expected behavior? The request fails immediately with ECONNREFUSED: What do you see instead? Deno returns ETIMEOUT and takes more an additional few seconds to end Additional information No response”
“What version of Bun is running? 1.4.0 canary.1+5ac120ca3 What platform is your computer? Linux 6.12.86+deb13 amd64 x86 64 x86 64 What steps can reproduce the bug? Hi, I would like to report a behavior in Bun that can be reproduced using the below snippet: What is the expected behavior? What do you see instead? Bun’s node:dns.lookup does not match Node.js error behavior for DNS resolution failures. Node returns a standard Error with code: "EAI AGAIN", while Bun returns a DNSException with code: "”
“What version of Bun is running? 1.3.11 canary.1+9e93bfa1b What platform is your computer? Linux 5.10.0 12 amd64 x86 64 x86 64 What steps can reproduce the bug? Hi, I would like to report a behavior in Bun that can be reproduced using the below PoC: 1. npm install jsdoc prefix . 2. bun run node modules/jsdoc/jsdoc.js What is the expected behavior? Works in Node without error What do you see instead? jsdoc dependency requizzle throws error Additional information This was previously reported in htt”
“What version of Bun is running? 1.3.11 canary.1+9e93bfa1b What platform is your computer? Linux 5.10.0 12 amd64 x86 64 x86 64 What steps can reproduce the bug? Hi, I would like to report a behavior in Bun that can be reproduced using the below snippet: What is the expected behavior? What do you see instead? dns.lookup("mongo 1") resolves to 127.0.0.1 in Node and Deno, but returns ::1 in Bun. This causes behavior differences in code Additional information No response”
“What version of Bun is running? 1.3.5 What platform is your computer? Darwin 24.6.0 arm64 arm What steps can reproduce the bug? 1. create file index.ts with content: Bun.serve({ hostname: "something.localhost", fetch: () = new Response("Hello") }); 2. run bun index.ts What is the expected behavior? server is started with custom localhost subdomain What do you see instead? Additional information No response”
“What version of Bun is running? 1.2.13 What platform is your computer? Darwin 24.5.0 x86 64 i386 What steps can reproduce the bug? Pre reqs: install node + npm install bun package.json: test/test.js: cli commands: What is the expected behavior? Both bun and node pass test What do you see instead? bun fails test: 1. process.argv0 and process.argv[0] are swapped vs node. 2. the subcommand test is not included in args at all in bun, which disagrees with both node and ps. Additional information No r”
