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';
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';