Skip to content

ethers fails at link: undefined references from a re-export-from-builtin shape (export { createHash, ... } from "crypto"), now reachable after #10757 #10802

Description

@proggeramlug

With the HIR-lowering blowup fixed (#10757 / PR #10801), ethers 6.17.0's full 153-module dependency tree now lowers and generates code in about a minute. It then fails at the link step on undefined references.

Found immediately after #10757's fix, on origin/main + PR #10801, Linux x64.

The shape

The undefined symbols come from ethers/src.ts/crypto/crypto.ts, which re-exports node builtins:

export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto";

plus one WebSocket wrapper symbol.

So this is an export { … } from "<node builtin>" pass-through — the module re-exports names it never imports into its own scope — and those symbols are not emitted or resolved at link time.

Why it is filed separately

It is unrelated to #10757: that was an exponential blowup in class_mutates_capture's recursion, entirely within HIR lowering. This is a linker-visible symbol-emission problem that only became reachable because lowering now completes. The #10757 fix is correct and complete for what it claims; this is the next thing in the way.

That is also the expected pattern for this campaign — each blocker removed exposes the next. It is the removals doing their job, not evidence the previous fix was wrong.

Reproduction

mkdir ethers-probe && cd ethers-probe
npm install ethers@6.17.0
# package.json: { "perry": { "compilePackages": ["ethers"] } }
# fixture.ts: import { Wallet } from "ethers"; ...
perry compile fixture.ts -o fixture    # lowers + codegens, then fails at link

Suggested first check

Whether a minimal export { createHash } from "crypto"; inside a compiled package reproduces it without ethers. If it does, the defect is in the re-export-from-builtin path generally, and is likely to affect any package wrapping node crypto — a common shape in anything that hashes or signs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package-auditFound by the 2026 package audit: compiling real npm packages from source instead of native bindings

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions