Skip to content

viem/account-abstraction breaks tree-shaking in v2.42.0+ due to EntryPoint v0.9 ABI #4174

@gryyny

Description

@gryyny

Check existing issues

Viem Version

viem 2.42.0+ (works correctly in 2.41.2)

Current Behavior

After upgrading from viem 2.41.2 to 2.42.0+, Next.js build times increased from ~54 seconds to ~2:42 (3x slower).

Bundle analysis shows the entire entryPoint09Abi (~870 lines) is being included in the bundle even when only importing a simple constant like entryPoint07Address from viem/account-abstraction.

The new EntryPoint v0.9 ABI added in PR #4134 appears to break tree-shaking for the account-abstraction module.

Expected Behavior

Importing specific exports from viem/account-abstraction should only include those exports in the bundle.

Unused ABIs (like entryPoint09Abi) should be tree-shaken when not explicitly imported.

Steps To Reproduce

  1. Create a Next.js 16 project with viem 2.42.0+
  2. Import only a specific constant: import { entryPoint07Address } from 'viem/account-abstraction'
  3. Run next build
  4. Observe bundle includes the full EntryPoint v0.9 ABI (~870 lines) even though it wasn't imported

Workaround: Pin viem to 2.41.2

Link to Minimal Reproducible Example

N/A - issue is observable via bundle size analysis on any Next.js project using viem/account-abstraction

Anything else?

  • Next.js 16.0.10 with Turbopack
  • Build time regression: 54s → 2:42 (3x slower)
  • Pinning to viem 2.41.2 resolves the issue
  • Likely cause: entryPoint09Abi is referenced at module scope or the module has side-effects preventing tree-shaking
  • Related: PR feat: entrypoint 0.9 + paymasterSignature #4134 (feat(account-abstraction): add entrypoint v0.9 support)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions