soul icon indicating copy to clipboard operation
soul copied to clipboard

Request: Update better-sqlite3 to support Node.js 24

Open IanMayo opened this issue 2 months ago • 1 comments

Problem

Soul-cli currently depends on better-sqlite3: ^8.1.0, which does not support Node.js 24. This prevents applications using soul-cli from upgrading to Node.js 24, which is now the current release.

Current situation:

  • soul-cli versions 0.7.8 and 0.8.2 both require better-sqlite3: ^8.1.0
  • better-sqlite3 v8.x supports Node.js 14.x through 20.x
  • Node.js 24 requires better-sqlite3 v12.0.0 or later

Error when trying to run on Node.js 24: Applications crash or fail to start because better-sqlite3 v8.x native modules cannot load on Node.js 24.

Solution

Update the dependency in soul-cli's package.json:

{
  "dependencies": {
    "better-sqlite3": "^12.4.1"
  }
}

better-sqlite3 Version Compatibility

  • v8.x: Supports Node.js 14.x - 20.x
  • v12.0.0: Added Node.js 24 support (but had missing prebuild binaries)
  • v12.1.0+: Full Node.js 24 support with complete prebuild binaries
  • v12.4.1 (current): Supports Node.js 20.x, 22.x, 23.x, and 24.x

Breaking Changes Assessment

The better-sqlite3 API is stable between v8.x and v12.x. The main breaking change in v12.0.0 was:

  • Dropped Node.js 18 support
  • Added Node.js 24 support

No API changes that should affect soul-cli's usage. The upgrade should be straightforward.

Benefits

  1. Node.js 24 support: Enables applications to use the latest Node.js version
  2. Future-proofing: Node.js 20 reaches EOL in April 2026
  3. Performance: Access to Node.js 24 performance improvements
  4. Security: Latest Node.js security updates
  5. Ecosystem alignment: Keeps soul-cli compatible with modern Node.js versions

Testing Checklist

Before merging, the following should be tested:

  • [ ] Database connection and initialization
  • [ ] CRUD operations (CREATE, READ, UPDATE, DELETE)
  • [ ] Transaction support
  • [ ] Custom SQL queries
  • [ ] Authentication/authorization functionality
  • [ ] WebSocket/realtime features
  • [ ] All existing soul-cli features continue to work
  • [ ] Test on Node.js 20, 22, and 24

Workaround for Users

Until this is merged, users can work around this by using yarn resolutions:

{
  "resolutions": {
    "better-sqlite3": "^12.4.1"
  }
}

However, this is not officially supported and requires extensive testing.

Additional Context

  • Node.js 24 was released in October 2024
  • better-sqlite3 v12.1.0 with full Node.js 24 support was released in November 2024
  • This affects all soul-cli users wanting to adopt Node.js 24

Proposed PR

I'm willing to submit a pull request for this change if you're open to it. The change should be minimal - just updating the dependency version and running tests to confirm compatibility.


References:

IanMayo avatar Nov 12 '25 11:11 IanMayo

Thanks, Ian! I’m okay with you taking this on — feel free to open the PR whenever ready.

thevahidal avatar Nov 12 '25 19:11 thevahidal

Thanks, Ian! I’m okay with you taking this on — feel free to open the PR whenever ready.

Thanks Vahid, PR here: https://github.com/thevahidal/soul/pull/230

IanMayo avatar Nov 25 '25 10:11 IanMayo

Thanks, Ian! I’m okay with you taking this on — feel free to open the PR whenever ready.

Thanks Vahid, PR here: #230

Hey @IanMayo, thanks for the PR. Sorry I didn't respond earlier, I was on a trip. I left a comment on your PR, you need to bump Soul version.

thevahidal avatar Nov 30 '25 12:11 thevahidal

you need to bump Soul version.

Got it, thanks. On my dev machine I need to apply some fixes to get the unit tests working. I'll produce a PR (https://github.com/thevahidal/soul/pull/232) for that, branching off main, and will then re-apply these changes to the fixed main (bumping version in both).

IanMayo avatar Nov 30 '25 15:11 IanMayo