Closed Noxdor closed 10 months ago
Thanks @Noxdor! I actually didn't know about import "dotenv/config";
that's cool, and I've tested it here and it works. This is all in the PR above.
@mikemaccana I am happy to help and excited, my suggestions will make it to the website :slightly_smiling_face:
The dotenv/config
import was added, when ES modules were gaining traction and people started switching to them.
Have a great week!
I am talking about this page: https://www.soldev.app/course/intro-to-writing-data
In the Lab section, you can find the following code example which I annotated with comments where I think the block could be improved:
This is what I would suggest the code to update to:
The original code block on the website is actually not working at all. You import * as web3 from "@solana/web3.js" and then use the PublicKey constructor directly, which is not possible. Instead you would have to call the constructor like this: new web3.PublicKey(suppliedToPubkey).