-
Notifications
You must be signed in to change notification settings - Fork 128
getting undefined error of JsonRpcProvider #76
Comments
const { ethers, JsonRpcProvider } = require("ethers") |
not working still giving the same error |
check ethers version, is the key,reason is version update |
@42maojin thanx, worked for me |
Hey guys, I'll copy-paste an answer I gave, I was stuck on the same problem. const { ethers } = require("ethers"); async function main() { main() I unistalled the node_modules and reinstalled it. Also I'm using Ethers 5.6.2 and modify a little bit of the code listening to some this and input from ChatGPT. Good luck bro! |
what i got to know in the later versions the file structure was more well defined so as to put the jsonRpcProvider in the providers , but in the earlier section the JsonRpcProvider was in the ethers itself you can try this instead const provider = new ethers.JsonRpcProvider(
"http://127.0.0.1:7545/"
); |
The text was updated successfully, but these errors were encountered: