Issue when calling a function web3js

i tried using web3.js with moralis to call functions but i keep getting an error.

await Moralis.enableWeb3();

const web3Js = new Web3(Moralis.provider);

web3Js.eth.getAccounts(console.log)
returns the address also when i try

web3Js.eth.getBalance also returns values but with

web3Js.Provider i get an error is not a function

i get an error web3Js is not a function also when i try web3Js.createBatch

what are you trying to do?

where are you running that code? front end or backend

in lastest version of the sdk you get an ethers object from Moralis.enableWeb3()

I’m running it on the frontend, i want to use web3.js only and not ethers how is this done ?

You can install and use web3.js separately.

You can read the web3.js docs to see what you can use. You can also console.log(web3Js) to find out what’s available in the object directly.