PANE

Bun produces NaN instead of Node-compatible output

11 posts since Mar 2024, all from GitHub.

“What is the problem this feature would solve? A tool that runs bun check and maps its diagnostics somewhere else needs their spans. no pretty prints file(line,col): error TSxxxx: message , as tsc pretty false does: where an error starts, not how long it is, and message chains as…”
GitHub
“What version of Bun is running? 1.4.0+34cbb9a40 What platform is your computer? Linux x86 64: GitHub Actions runner blacksmith 4vcpu ubuntu 2404 (4 vCPU), Ubuntu 24.04.4 LTS, rootfs ubuntu24 full x64 081926 . The kernel version was not printed in these runs; we can print uname a…”
GitHub
“What version of Bun is running? 1.4.4 canary.1+ed680823c What platform is your computer? Linux 6.8.0 1066 aws x86 64 x86 64 What steps can reproduce the bug? tsconfig.json index.ts flags is declared twice: as a required global var (so it's a required property of typeof…”
GitHub

Users are encountering unexpected behavior in Bun, specifically that `console.log('%i', array)` outputs `NaN` instead of the expected `1` like Node.js and Deno. This issue is reproducible with a specific snippet and affects array output.

devtoolsbugbunjavascriptarray
FIT
0%
SIGNAL
56%
SOURCES11
FRESHEST POSTOCT 23
TRACKED SINCE45D AGO

SOURCES (11)

“What version of Bun is running? 1.4.0+34cbb9a40 What platform is your computer? Linux x86 64: GitHub Actions runner blacksmith 4vcpu ubuntu 2404 (4 vCPU), Ubuntu 24.04.4 LTS, rootfs ubuntu24 full x64 081926 . The kernel version was not printed in these runs; we can print…”

GITHUBOct 23

“What version of Bun is running? 1.4.4 canary.1+ed680823c What platform is your computer? Linux 6.8.0 1066 aws x86 64 x86 64 What steps can reproduce the bug? tsconfig.json index.ts flags is declared twice: as a required global var (so it's a required property of typeof globalThis ) and as an optional property of the other half of the intersection. A property of an intersection is required if any part has it as required. So w.flags is required, and { ...w } should keep it required. What is the ex”

GITHUBOct 18

“What is the problem this feature would solve? A tool that runs bun check and maps its diagnostics somewhere else needs their spans. no pretty prints file(line,col): error TSxxxx: message , as tsc pretty false does: where an error starts, not how long it is, and message chains as indented continuation lines that have to be parsed back. Our case is vue typecheck, a bridge until components are supported natively ( 45163): @vue/language core (the codegen vue tsc uses) turns every SFC into TypeScript”

GITHUBOct 17

“What version of Bun is running? 1.4.3+c6da4a4d3 What platform is your computer? Linux 7.2.9 (WSL2, x86 64) What steps can reproduce the bug? 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? A one shot SHA 256 of a short string costs about what it does in Node (142 ns for 51 bytes, 234 ns for 284 bytes). What do you see instead? crypto.hash('sha256', string, 'hex') of a”

GITHUBOct 17

“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux 7.0.12 arch1 1 x86 64 unknown What steps can reproduce the bug? Run a bun test with: See https://github.com/tuaki/bun bugs/tree/master/to equal float 16 array nan for full example. What is the expected behavior? The test should pass. What do you see instead? The test fails. Additional information Typed arrays are compared by values and expect(NaN).toEqual(NaN) passes, so there is no reason why this should fail”

GITHUBJul 20

“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? When an array is passed as the argument for %i, Bun produces NaN whereas Node.js and Deno produce 1. Additional information No response”

GITHUBJun 3

“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Linux 6.8.0 111 generic x86 64 x86 64 What steps can reproduce the bug? 1. create file test.js with the following content: 2. run it with bun test.js What is the expected behavior? in Node.js it outputs What do you see instead? in Bun it outputs Additional information No response”

GITHUBJun 2

“What version of Bun is running? 1.3.1+89fa0f343 What platform is your computer? Linux 6.17.0 6 generic x86 64 unknown What steps can reproduce the bug? Create and run simple express server route calling res.json() with no args. Create another file using fetch and Response.json() . Run client file with bun : No error thrown and null is logged. Run client file with node : Error thrown SyntaxError: Unexpected end of JSON input What is the expected behavior? Same behavior as node . What do you see i”

GITHUBNov 2025

“What version of Bun is running? 1.2.1 What platform is your computer? Linux 5.10.16.3 microsoft standard WSL2 x86 64 x86 64 What steps can reproduce the bug? What is the expected behavior? Alternatively, it can fail with some error that the recieved value is not a collection What do you see instead? Additional information According to the tests here, there is no test for null or undefined . In the code here, there is no check for null or undefined , however, there is a check for NaN .”

GITHUBFeb 2025

“What version of Bun is running? 1.1.27+267afa293 What platform is your computer? Linux 6.5.13 7 MANJARO x86 64 unknown What steps can reproduce the bug? What is the expected behavior? Both console.log outputs are the same. I've tested it with Node and there the output is What do you see instead? Additional information No response”

GITHUBSep 2024

“What version of Bun is running? 1.0.29+a146856d1 What platform is your computer? Linux 5.15.133.1 microsoft standard WSL2 x86 64 x86 64 What steps can reproduce the bug? I have noticed strange behaviour of console.log() when using Bun.serve() , I am unsure as to what exactly causes the bug. To help with investigation I have two separate branches of nearly identical code where api.js file serves a HTTP GraphQL server with GraphiQL. Branch console log node serves HTTP with use of node, node:http h”

GITHUBMar 2024

SOLUTION LANDSCAPE

Brought to you byTop Sectors

A Player feature.See how many ways this pain can be solved, who's already building, and where the gaps are.

Related panes

/ same corner of the problem