Skip to content

Fix Node 22 compatibility by updating better-sqlite3 to v10.1.0 #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 18, 2025

This PR addresses Node 22 compatibility issues in the dapp-offer-up project by updating the better-sqlite3 dependency to version 10.1.0, which includes Node 22 support.

Changes Made

✅ Fixed: better-sqlite3 Compatibility

  • Updated better-sqlite3 from versions 8.7.0 and 9.6.0 to 10.1.0
  • Added "better-sqlite3": "^10.0.0" to package.json resolutions to force the upgrade
  • Verified the new version works correctly with Node 22 after rebuilding native modules

📋 Documented: ESM Module Issue

  • Added comprehensive documentation in NODE_22_COMPATIBILITY.md
  • Identified that the esm module from github:agoric-labs/esm#Agoric-built is incompatible with Node 22
  • The ESM module causes assertion failures when running on Node 22

Testing Results

Node 20 (Current)

  • ✅ All builds pass
  • ✅ All contract tests pass (7/7)
  • ✅ better-sqlite3 works correctly

Node 22 (Target)

  • ✅ better-sqlite3 works correctly (after rebuild)
  • ❌ Build fails due to ESM module assertion error:
    #  Assertion failed: (args.Length()) >= (2)
    ----- JavaScript stack trace -----
    1: /path/to/node_modules/esm/esm.js:1:155566
    

Status

Partial Node 22 compatibility achieved - This PR resolves one of the two main compatibility issues:

  1. better-sqlite3 ✅ - Fixed by updating to v10.1.0
  2. ESM module ❌ - Requires upgrading to newer Agoric SDK version

Next Steps

To achieve full Node 22 compatibility, the project needs to upgrade to a newer version of the Agoric SDK (v0.22.0-u17 or later) that no longer depends on the problematic ESM module. Both referenced issues (#4788 and #11272) have been resolved in newer SDK versions.

Addressing #121.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
  • edgedl.me.gvt1.com
  • iojs.org

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] compatibility with Node 22 Fix Node 22 compatibility by updating better-sqlite3 to v10.1.0 Jul 18, 2025
Copilot finished work on behalf of toliaqat July 18, 2025 05:03
@Copilot Copilot AI requested a review from toliaqat July 18, 2025 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants