Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error happened while import zksync in js #325

Open
shiweixu97 opened this issue Mar 28, 2023 · 3 comments
Open

error happened while import zksync in js #325

shiweixu97 opened this issue Mar 28, 2023 · 3 comments

Comments

@shiweixu97
Copy link

I'm trying to connect to zksync by js. However, something wrong happened when I import zksync lib. My node version is 18.15.0

the log shows:
/data/shiweixu/zksync/node_modules/zksync/build/utils.js:23
exports.IERC20_INTERFACE = new ethers_1.utils.Interface(require('../abi/IERC20.json').abi);
^

TypeError: Cannot read properties of undefined (reading 'Interface')
at Object. (/data/shiweixu/zksync/node_modules/zksync/build/utils.js:23:47)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object. (/data/shiweixu/zksync/node_modules/zksync/build/eth-message-signer.js:33:17)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)

and the code of the file is only one line:
import * as zksync from 'zksync';

@bankel
Copy link

bankel commented Jun 27, 2023

I had the same problem:
exports.IERC20_INTERFACE = new ethers_1.utils.Interface(require('../abi/IERC20.json').abi);
^
TypeError: Cannot read properties of undefined (reading 'Interface')
at Object. (/Users/lyf/ethereum_studio/node_modules/zksync/build/utils.js:23:47)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Object.require.extensions. [as .js] (/usr/local/lib/node_modules/ts-node/src/index.ts:1608:43)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Function.Module._load (node:internal/modules/cjs/loader:922:12)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (/Users/lyf/ethereum_studio/node_modules/zksync/build/eth-message-signer.js:33:17)
at Module._compile (node:internal/modules/cjs/loader:1218:14)

@keriat please any help

@ManutdGTA
Copy link

same issue
"zksync": "^0.13.1"
"ethers": "^6.7.1",

@ManutdGTA
Copy link

yarn remove ethers
yarn add [email protected]

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

No branches or pull requests

3 participants