accounts = await Web3.eth.getAccounts();
^
TypeError: Cannot read properties of undefined (reading 'getAccounts')
Code to reproduce
accounts = await Web3.eth.getAccounts();
^
TypeError: Cannot read properties of undefined (reading 'getAccounts')
You can share your full code
I have a try like this:
const web3 = new Web3('https://eth.llamarpc.com');
(async () => {
const accounts = await web3.eth.getAccounts();
console.log('accounts', accounts);
})();
the result is:
accounts []