Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions NODE_22_COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Node 22 Compatibility

## Current Status

This document describes the current state of Node 22 compatibility for the dapp-offer-up project.

## Issues Fixed

### βœ… better-sqlite3 Compatibility

- **Issue**: The project was using better-sqlite3 versions 8.7.0 and 9.6.0 which don't support Node 22.
- **Solution**: Updated to better-sqlite3 v10.1.0 which supports Node 22.
- **Changes**:
- Added `"better-sqlite3": "^10.0.0"` to package.json resolutions
- Updated yarn.lock to use the new version
- **Status**: βœ… Fixed and tested

## Issues Remaining

### ❌ ESM Module Compatibility

- **Issue**: The project uses the `esm` module from `github:agoric-labs/esm#Agoric-built` which is not compatible with Node 22.
- **Error**: Node crashes with assertion failure when using ESM module:
```
# Assertion failed: (args.Length()) >= (2)
----- JavaScript stack trace -----
1: /home/runner/work/dapp-offer-up/dapp-offer-up/node_modules/esm/esm.js:1:155566
```
- **Root Cause**: The ESM module is a fork that hasn't been updated for Node 22 compatibility.
- **Solution**: Upgrade to a newer version of the Agoric SDK that no longer depends on the ESM module.

## Testing Results

### Node 20 (Current)
- βœ… All builds pass
- βœ… All tests pass
- βœ… better-sqlite3 works correctly

### Node 22 (Target)
- ❌ Build fails due to ESM module assertion error
- βœ… better-sqlite3 works correctly (after rebuild)
- ❌ Cannot run tests due to ESM module failure

## Next Steps

To fully achieve Node 22 compatibility, the project needs to:

1. **Upgrade Agoric SDK**: Update to a version that has removed the ESM dependency (likely v0.22.0-u17 or later)
2. **Update Dependencies**: Ensure all @agoric/* packages are compatible with the newer SDK
3. **Test Thoroughly**: Verify all functionality works with the new SDK version

## References

- [Agoric SDK Issue #4788](https://github.com/Agoric/agoric-sdk/issues/4788) - Remove remaining 'esm' module loader dependencies
- [Agoric SDK Issue #11272](https://github.com/Agoric/agoric-sdk/issues/11272) - Bump better-sqlite3 to 10+

Both issues are closed, indicating the fixes are available in newer versions of the Agoric SDK.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"license": "Apache-2.0",
"private": true,
"packageManager": "[email protected]",
"packageManager": "[email protected]+sha512.5a0afa1d4c1d844b3447ee3319633797bcd6385d9a44be07993ae52ff4facabccafb4af5dcd1c2f9a94ac113e5e9ff56f6130431905884414229e284e37bb7c9",
"useWorkspaces": true,
"workspaces": [
"contract",
Expand All @@ -12,6 +12,7 @@
"resolutions-note": "work-around for https://github.com/Agoric/agoric-sdk/issues/8621",
"resolutions": {
"agoric": "^0.22.0-u16.2",
"better-sqlite3": "^10.0.0",
"ses": "1.8.0",
"@agoric/notifier": "^0.7.0-u16.1",
"@endo/bundle-source": "^3.4.0",
Expand Down
19 changes: 4 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5471,25 +5471,14 @@ __metadata:
languageName: node
linkType: hard

"better-sqlite3@npm:^8.2.0":
version: 8.7.0
resolution: "better-sqlite3@npm:8.7.0"
dependencies:
bindings: "npm:^1.5.0"
node-gyp: "npm:latest"
prebuild-install: "npm:^7.1.1"
checksum: 10c0/2583401b08531eee74c083c73f3a5902bc142b0e1c16de5b9caa92ee94f544e2cb512c214de2f762a6c83e593f26f70013214344a9ea66ace6d0619efbf04a1e
languageName: node
linkType: hard

"better-sqlite3@npm:^9.1.1":
version: 9.6.0
resolution: "better-sqlite3@npm:9.6.0"
"better-sqlite3@npm:^10.0.0":
version: 10.1.0
resolution: "better-sqlite3@npm:10.1.0"
dependencies:
bindings: "npm:^1.5.0"
node-gyp: "npm:latest"
prebuild-install: "npm:^7.1.1"
checksum: 10c0/8db9b38f414e26a56d4c40fc16e94a253118491dae0e2c054338a9e470f1a883c7eb4cb330f2f5737db30f704d4f2e697c59071ca04e03364ee9fe04375aa9c8
checksum: 10c0/3c858214b8b6f0c3f536759a863dfc79b11c52cecd6061525fb7707d950ea2ef369280276d8cc62d504119514b7d32ea4aab134d260f6b5a0419a8119d613a67
languageName: node
linkType: hard

Expand Down