Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

BigNumber undefined #104

Open
saugion opened this issue Sep 4, 2023 · 2 comments
Open

BigNumber undefined #104

saugion opened this issue Sep 4, 2023 · 2 comments

Comments

@saugion
Copy link

saugion commented Sep 4, 2023

I receive the following error when I build my application:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'from')

It comes from
exports.DEFAULT_VERIFICATION_GAS_LIMIT = ethers_1.ethers.BigNumber.from(70000);
in builder.js

userop version is 0.3.3, ethers is 6.7.1, the latest.

Also constants like ethers.constants.ZeroAddress, ethers.constants.Zero, ethers.utils.hexlify , ethers_1.ethers.providers.JsonRpcProvider are not present in the latest ethers version.

I've also tried different versions but the issue persists. Could it be a conflict with other libraries? Thanks

@saugion
Copy link
Author

saugion commented Sep 5, 2023

I think the issue appears because i'm using ethers v6 in my project, but userop has a dependency to ethers v5. The framework i'm using seems to override the v5 with v6 at build time. It would be for userop to use ethers v6.

@ketanjog
Copy link

Got the same issue and you're right its bc ethers deprecated their use of BigNumber. I got around this by just going in and either swapping or wrapping with javascript's BigInt. Not sure if it'll work everytime but worth a try

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants