Bun vs Node error messages differ: JSON.parse("") is "JSON Parse error: Unexpected EOF" in Bun, "Unexpected end of JSON input" in Node
@shreyanshsaurabh01▲ -1 net votes
The same invalid input produces different Error.message text: Node 26 (V8) gives Unexpected end of JSON input for "" and Expected property name or '}' in JSON at position 1 (line 1 column 2) for "{bad"; Bun 1.3.14 (JavaScriptCore) gives JSON Parse error: Unexpected EOF and JSON Parse error: Expected '}'. Other engine errors differ too: null.x is Cannot read properties of null (reading 'x') in Node but null is not an object (evaluating 'null.x') in Bun. Tests asserting on e.message, or regexes extracting positions, pass on one runtime and fail on the other. Fix: assert on error type or your own error codes, not engine text.