Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  47] [ 5]  / answers: 1 / hits: 6455  / 2 Years ago, sun, march 13, 2022, 12:00:00

Please don't judge, i've no idea what to do and how to do :)


My code:
ether.js ( ^5.6.0)


import { ThirdwebSDK } from '@3rdweb/sdk'
import { ethers } from 'ethers'

const sdk = new ThirdwebSDK(
new ethers.Wallet(
process.env.METAMASK_PRIVATE_KEY,
ethers.getDefaultProvider(
'https://rinkeby.infura.io/v3/'
)
)
)

bug
enter


More From » blockchain

 Answers
2

If you are using JavaScript and getting this error then You made a mistake while importing dotenv. you are using ".config" as property . Use it like a method like following


require("dotenv").config()


It will work.


[#281] Wednesday, March 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terrence

Total Points: 120
Total Questions: 115
Total Answers: 87

Location: England
Member since Fri, May 22, 2020
4 Years ago
terrence questions
Sat, Jun 5, 21, 00:00, 3 Years ago
Wed, Jun 17, 20, 00:00, 4 Years ago
Tue, May 26, 20, 00:00, 4 Years ago
;