Skip to content

Restore @noble/hashes override to fix electron-builder ERR_REQUIRE_ESM regression#19

Merged
NamecoinGithub merged 1 commit into
Mergingfrom
copilot/restore-noble-preset-bug-fix
Jul 10, 2026
Merged

Restore @noble/hashes override to fix electron-builder ERR_REQUIRE_ESM regression#19
NamecoinGithub merged 1 commit into
Mergingfrom
copilot/restore-noble-preset-bug-fix

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown

electron-builder packaging (npm run package-linux and friends) crashes with ERR_REQUIRE_ESM. A prior fix for this pinned electron-builder to 26.13.1 and added a @noble/hashes override, but a later dependency bump to electron-builder@26.15.3 dropped the override, silently reintroducing the bug.

Root cause

  • app-builder-lib@26.15.3 (bundled with electron-builder) does require("@noble/hashes/blake2.js") in out/targets/blockmap/blockmap.js.
  • @noble/hashes@2.x is ESM-only ("type": "module"), so a static CJS require() of it throws at runtime.
  • The lockfile currently resolves @noble/hashes to ^2.2.0 for this transitive dependency.

Changes

  • package.json — add "@noble/hashes": "1.7.1" back to overrides, forcing the CJS-compatible version for this transitive dependency.
  • package-lock.json — regenerated so @noble/hashes resolves to 1.7.1 wherever pulled in transitively.

electron-builder itself stays on 26.15.3 (current, exact-pinned) rather than being downgraded — only the broken transitive dependency is constrained:

"overrides": {
  "react": "$react",
  "react-dom": "$react-dom",
  "@noble/hashes": "1.7.1"
}

@NamecoinGithub
NamecoinGithub marked this pull request as ready for review July 10, 2026 08:26
Copilot AI review requested due to automatic review settings July 10, 2026 08:26
@NamecoinGithub
NamecoinGithub merged commit 1c8ba06 into Merging Jul 10, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores an npm overrides constraint to force a CommonJS-compatible @noble/hashes version, aiming to prevent electron-builder / app-builder-lib packaging from crashing with ERR_REQUIRE_ESM.

Changes:

  • Add @noble/hashes@1.7.1 to package.json overrides.
  • Update package-lock.json to include @noble/hashes@1.7.1 in the resolved dependency set.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Reintroduces an overrides pin for @noble/hashes to avoid ESM-only transitive resolution during packaging.
package-lock.json Updates lockfile resolution to include @noble/hashes@1.7.1 (but still needs correction to fully remove/replace the nested 2.x copy under app-builder-lib).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants