-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
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
- Create a Next.js 16 project with viem 2.42.0+
- Import only a specific constant:
import { entryPoint07Address } from 'viem/account-abstraction' - Run
next build - 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)