Lesson 5: Running into a TypeError while entering private key value in encryptKey.js #5363
-
I just started out with Lesson 5 and typed out the first few lines of code in encryptKey.js. Here's my code:
I keep running into the following issue:
I've tried reinstalling node modules, and making sure that I am adding the correct environment variable. I am not exactly sure why this type error occurs. Has the syntax changed after an update or so? Please let me know if you have faced a similar issue or have any suggestions. Thanks in advance! Here's the timestamp from the course for reference: https://youtu.be/gyMwXuJrbJQ?t=27855 And a link to my repo if needed: https://github.com/namyasharma/ethers-simple-storage |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@namyasharma It says the value of And you should continue this discussion and close the issue, because this is not a course related issue instead it is a personal code issue. |
Beta Was this translation helpful? Give feedback.
-
const encryptedJsonKey = await ethers.encryptKeystoreJson Not this function const encryptedJsonKey = await wallet.encrypt change with Wallet.encrypt and check #4820 (comment) |
Beta Was this translation helpful? Give feedback.
@namyasharma It says the value of
PRIVATE_KEY
is undefined. Are you sure you have installed the dotenv package and you havePRIVATE_KEY
inside the .env file?And you should continue this discussion and close the issue, because this is not a course related issue instead it is a personal code issue.