fix(db): native SQLite backend on Node 24 (#203)#216
Merged
Conversation
…ckend (#203) better-sqlite3 ^11.0.0 (latest 11.10.0) ships no prebuilt binary for Node 24's ABI (node-v137) and predates Node 24, so every Node 24 install silently fell back to the 5-10x-slower WASM backend. Bump to ^12.4.1 — the first 12.x with the Node 24 prebuild — and raise the engines floor to Node 20 (Node 18 is EOL and dropped from better-sqlite3 12.x prebuilds). Verified on macOS Node 24.15.0 (ABI 137): prebuilt binary used with no compiler (installs even with CC/CXX sabotaged), `codegraph init -i` shows no WASM banner, and `codegraph status` reports Backend: native. 639/639 tests pass on Node 22. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Node 24,
codegraph init -ialways fell back to the WASM SQLite backend, printing abetter-sqlite3 unavailablewarning that no amount ofnpm rebuild better-sqlite3/xcode-select --installcould clear.Root cause:
optionalDependencies.better-sqlite3was pinned to^11.0.0. The latest v11 (11.10.0) ships no prebuilt binary for Node 24's ABI (node-v137) and predates Node 24, so the optional dependency silently failed to load → WASM fallback. Compounded by the fact that CodeGraph is usually installed globally: thenpm install/npm rebuildusers ran in their own project never touched CodeGraph's copy.Fix
better-sqlite3^11.0.0→^12.4.1— the first 12.x release whose prebuilds include Node 24 (node-v137).engines.node>=18.0.0→>=20.0.0— Node 18 is EOL and dropped from better-sqlite3 12.x prebuilds.Verification (real macOS, Node 24.15.0, ABI 137)
npm install better-sqlite3@^12.4.1pulls the prebuilt12.10.0binary — confirmed native even with the compiler sabotaged (CC=CXX=/usr/bin/false, installs in 768 ms), proving no compiler is required.codegraph init -i→ no WASM banner;codegraph status→Backend: native.Note
12.10.0prebuilds Node 22 and Node 24; Node 20/21/23 fall to the WASM fallback (still functional). Node 22 and Node 24 are the active LTS lines.Thanks to @Finndersen for the clear report.
Fixes #203
🤖 Generated with Claude Code