Skip to content

Commit 7507605

Browse files
committed
fix: Add Node.js 25+ compatibility warning for V8 WASM compiler bugs
Addresses potential crashes on Node.js 25+ due to V8 turboshaft WASM compiler issues. Adds runtime version check with warning to recommend Node.js 22 LTS and sets upper bound engine constraint to
1 parent f402ab8 commit 7507605

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
"sqlite-vss": "^0.1.2"
5555
},
5656
"engines": {
57-
"node": ">=18.0.0"
57+
"node": ">=18.0.0 <25.0.0"
5858
}
5959
}

src/bin/codegraph.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ async function loadCodeGraph(): Promise<typeof import('../index')> {
5050
const importESM = new Function('specifier', 'return import(specifier)') as
5151
(specifier: string) => Promise<typeof import('@clack/prompts')>;
5252

53+
// Warn about unsupported Node.js versions (Node 25+ has V8 turboshaft WASM bugs)
54+
const nodeVersion = process.versions.node;
55+
const nodeMajor = parseInt(nodeVersion.split('.')[0] ?? '0', 10);
56+
if (nodeMajor >= 25) {
57+
console.warn(
58+
'\x1b[33m⚠\x1b[0m CodeGraph may crash on Node.js %s due to a V8 WASM compiler bug in Node 25+.',
59+
nodeVersion
60+
);
61+
console.warn(
62+
' Please use Node.js 22 LTS instead: https://nodejs.org/en/download'
63+
);
64+
console.warn(
65+
' See: https://github.com/colbymchenry/codegraph/issues/81\n'
66+
);
67+
}
68+
5369
// Check if running with no arguments - run installer
5470
if (process.argv.length === 2) {
5571
import('../installer').then(({ runInstaller }) =>

0 commit comments

Comments
 (0)