Skip to content

Fix: dependency upgrade failures - #1397

Draft
Jem256 wants to merge 7 commits into
jamaljsr:masterfrom
Jem256:fix/dependency-upgrade-failures
Draft

Jem256 wants to merge 7 commits into
jamaljsr:masterfrom
Jem256:fix/dependency-upgrade-failures

Conversation

@Jem256

@Jem256 Jem256 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the CI failures blocking the Renovate "all non-major dependencies" PR (#1352). Each commit fixes one failure, so they can be reviewed and reverted separately. Two packages are held back instead of fixed, because fixing them properly requires larger changes. The bigger upgrades are discussed in #1398.

The failures

1. yarn install exits 1: the protobufjs patch no longer applies

dockerode 4.0.12 depends on protobufjs ^7.3.2, which installs protobufjs 7.6.6 at the top level, next to the 7.3.0 copy used by @grpc/proto-loader. patches/protobufjs+7.3.0.patch targets node_modules/protobufjs, so patch-package
fails and the install exits 1 in CI. Locally, patch-package only prints a warning, which makes this easy to miss. Reproduce it with CI=true yarn install --frozen-lockfile.

The patch is still needed: protobufjs 7.6.6 decodes 64-bit map keys (LND/tapd custom records, e.g. map<uint64, bytes> custom_records) into 8-byte hash strings rather than decimal strings. Upstream fixed this in protobufjs 8.2.0 (protobufjs/protobuf.js#2186), which converts these keys to decimal strings in toObject. But @grpc/proto-loader,
including the current 0.8.1, still requires protobufjs ^7, so we can't use that fix yet.

Fix: pin protobufjs to 7.6.6 in resolutions so only one copy is installed, and regenerate the patch for that version.

2. 145 test suites fail to load with ENOENT: open 'node:crypto'

dockerode 4.0.12 pulls in uuid@10, whose dist/rng.js does require("node:crypto"). Jest 26 (pinned by react-scripts 4) can't resolve the node: prefix. The app itself is not affected: webpack uses uuid's browser build, and the built bundle contains no node: requires.

Fix: a test-only moduleNameMapper entry that points node:crypto at a small shim. Mapping straight to "crypto" doesn't work, because Jest 26 then treats it as a file path.

3. 4 × TS2769: NodeJS.Timer is not accepted by clearInterval

@types/node 18.19 removed NodeJS.Timer from the clearInterval overloads.

Fix: use NodeJS.Timeout.

4. 4 × TS2345: CallHistoryMethodAction is not assignable to UnknownAction

easy-peasy 6.1 moves to redux 5, while connected-react-router (which provides push() and the router middleware) only supports redux ^3 || ^4. The store and the router actions end up typed by two different redux versions. easy-peasy 6.1 also requires React 18, and Polar is on React 17.

Fix: add easy-peasy to ignoreDeps. Taking the upgrade properly needs React 18 and a replacement for connected-react-router (last released in July 2022). See #1398.

5. 11 tests fail on re-thrown Modal.confirm onOk errors

antd 4.24.16 changed ActionButton to return Promise.reject(e) when onOk rejects. 4.24.12 logged the error and swallowed it. Six components (RemoveNode, RestartNode, NetworkView, CloseChannelButton, CustomImagesTable, SimulationDesignerTab) reject from onOk so the dialog stays open, and each of those rejections is now unhandled, which Jest counts as a test failure. The app behaves the same apart from an "Uncaught (in promise)" console message. The rejections can't be suppressed from test code, because jest-circus registers its handler on the real process, outside the test sandbox.

Fix: add antd to ignoreDeps. 4.24.16 is the last antd 4 release, so nothing else is missed. Changing the six dialogs needs a UX decision (close on error, or stay open for a retry) and belongs in its own PR.

6. 1 × TS2322: the middleware array is not assignable

@types/redux-logger 3.0.13 changed its dependency from redux ^4 to redux ^5, so createLogger() and routerMiddleware() now come from different redux versions.

Fix: type the array as redux 4's Middleware[] and cast the logger into it. Types only; redux-logger returns the same function either way.

7. yarn dev fails: webpack can't parse dockerode

dockerode 4.0.12 uses optional chaining (?.) in lib/docker.js. webpack 4 (from react-scripts 4) can't parse it unless Babel rewrites it first. Babel only rewrites syntax the target browsers don't support. The production browser list targets older browsers, so yarn build and yarn package pass. The development list targets last 1 chrome version, which supports ?., so Babel leaves it alone and yarn dev fails.

Fix: use the same browser list for development as for production, so Babel rewrites ?. in both.

Steps to Test

On Node 20 (matching CI), at the tip of this branch:

  • rm -rf node_modules && CI=true yarn install --frozen-lockfile: passes, protobufjs@7.6.6 ✔
  • yarn lint:all: passes
  • yarn test:ci: 161 suites, 2027 tests, 100% coverage
  • yarn build and yarn package: pass (all four Linux artifacts; rpmbuild required locally)
  • yarn dev: starts, and a network can be created and started

dockerode 4.0.12 adds a top-level protobufjs 7.6.6, so the 7.3.0 patch
no longer applies and `yarn install` fails. Pin protobufjs to 7.6.6 and
regenerate the patch against it.
uuid@10 (via dockerode 4.0.12) requires `node:crypto`, which Jest 26
cannot resolve, so every suite importing dockerode fails to load.
@types/node 18.19 no longer accepts the deprecated `NodeJS.Timer` in
`clearInterval`, so switch the auto-miner timers to `NodeJS.Timeout`.
easy-peasy 6.1 moves to redux 5, which conflicts with connected-react-router's
redux 4 types.
antd 4.24.16 re-rejects the promise when a Modal.confirm onOk fails, which
fails the tests that assert the error is displayed.
The new types depend on redux 5, so annotate the middleware array with
redux 4's `Middleware` type to keep it assignable.
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aa40bfc) to head (6e06a06).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1397   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          213       214    +1     
  Lines         7383      7384    +1     
  Branches      1505      1504    -1     
=========================================
+ Hits          7383      7384    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dockerode 4.0.12 ships `?.` syntax that webpack 4 cannot parse. CRA only
transpiles node_modules to the browserslist targets, and the development
targets already support it. Using the production targets in development
transpiles it, along with class fields and numeric separators.
@Jem256
Jem256 force-pushed the fix/dependency-upgrade-failures branch from 4cb08cb to 6e06a06 Compare September 22, 2026 20:35
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.

1 participant