Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workingnode.jsCompatibility with Node.js APIsCompatibility with Node.js APIs
Description
What happens
Four Node error codes have a message template in src/jsc/bindings/ErrorCode.cpp that differs from the template in Node's lib/internal/errors.js (node v26.3.0). The error code and the error class are correct. Only .message differs.
| code | bun 1.4.3-canary.1+367d939d9 | node v26.3.0 |
|---|---|---|
ERR_HTTP_SOCKET_ASSIGNED |
Socket already assigned |
ServerResponse has an already assigned socket |
ERR_TLS_INVALID_PROTOCOL_VERSION |
TLSv9 is not a valid minimum TLS protocol version |
"TLSv9" is not a valid minimum TLS protocol version |
ERR_TLS_PROTOCOL_VERSION_CONFLICT |
the template uses %s for both values |
TLS protocol version "TLSv1.2" conflicts with secureProtocol "TLSv1_2_method" |
ERR_IPC_CHANNEL_CLOSED |
Channel closed. in the template. child.send() after child.disconnect() gives Subprocess.send() can only be used if an IPC channel is open. |
Channel closed |
Repro
const tls = require("node:tls");
const http = require("node:http");
const { EventEmitter } = require("node:events");
function capture(fn) {
try {
fn();
} catch (e) {
return `${e.code} | ${e.name} | ${e.message}`;
}
return "no throw";
}
console.log(capture(() => tls.createSecureContext({ minVersion: "TLSv9" })));
console.log(capture(() => tls.createSecureContext({ minVersion: "TLSv1.2", secureProtocol: "TLSv1_2_method" })));
console.log(capture(() => {
const socket = new EventEmitter();
new http.ServerResponse({}).assignSocket(socket);
new http.ServerResponse({}).assignSocket(socket);
}));node v26.3.0:
ERR_TLS_INVALID_PROTOCOL_VERSION | TypeError | "TLSv9" is not a valid minimum TLS protocol version
ERR_TLS_PROTOCOL_VERSION_CONFLICT | TypeError | TLS protocol version "TLSv1.2" conflicts with secureProtocol "TLSv1_2_method"
ERR_HTTP_SOCKET_ASSIGNED | Error | ServerResponse has an already assigned socket
bun 1.4.3-canary.1+367d939d9:
ERR_TLS_INVALID_PROTOCOL_VERSION | TypeError | TLSv9 is not a valid minimum TLS protocol version
no throw
ERR_HTTP_SOCKET_ASSIGNED | Error | Socket already assigned
For ERR_IPC_CHANNEL_CLOSED:
const cp = require("node:child_process");
if (process.argv[2] === "child") {
setTimeout(() => {}, 1000);
} else {
const child = cp.fork(__filename, ["child"]);
child.disconnect();
child.send("x", e => {
console.log(e.code, JSON.stringify(e.message));
child.kill();
});
}node prints ERR_IPC_CHANNEL_CLOSED "Channel closed". bun prints ERR_IPC_CHANNEL_CLOSED "Subprocess.send() can only be used if an IPC channel is open.".
Notes
- Node formats the two TLS values with
%j(JSON.stringify), so it quotes them. ThesimpleErrorMessagestable inErrorCode.cpphas only%s-style pieces. - The second repro line also shows that bun does not throw
ERR_TLS_PROTOCOL_VERSION_CONFLICTfor that option pair at all. - Two tests hold the current text:
test/js/node/http/node-http.test.ts(toThrow("Socket already assigned")) and the first test oftest/js/node/errors/error-code-messages.test.ts(the TLS message). - The ported
test/js/node/test/parallel/test-child-process-send-after-close.jshas its upstreammessage: 'Channel closed'assertion commented out. - How I found them: a script compared the constant and table-driven messages in
ErrorCode.cppwith the literal templates in Node'slib/internal/errors.js. 108 of 118 are identical.ERR_INSPECTOR_ALREADY_CONNECTEDandERR_INSPECTOR_COMMANDhave a different template but give the same output. node: give seven ERR_* codes Node's message text #43502 fixes a related class: call sites whose arguments do not fit the template.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnode.jsCompatibility with Node.js APIsCompatibility with Node.js APIs
Activity
robobun commentedon Sep 19, 2026
Reproduced on main (26e7a4b): the four messages differ from node v26.3.0, and the secureProtocol conflict does not throw.
Fix in progress: #43594
node: give seven ERR_* codes Node's message text (#43502)
Jarred-Sumner commentedon Oct 8, 2026
Use handoff tool. GitHub issues are for user-facing issues and a user did not run into this issue
tls: consolidate the open TLS fixes (both engines, node:tls, node:htt…