I've made the code to send eth moralis using the video tutorial https://youtu.be/suZYvqrc_Hg but the code doesn't work can anyone explain

I’ve made the code to send eth moralis using the video tutorial https://youtu.be/suZYvqrc_Hg but the code doesn’t work can anyone explain

Can you share your code that you wrote?
You will also have to add await Moralis.enableWeb3() now to your code before calling Moralis.transfer, this is something that changed in Moralis SDK since that tutorial was filmed.

Did you get any errors in your browser console?
You should see something like:

Uncaught Error: Missing web3 instance, make sure to call Moralis.enableWeb3() or Moralis.authenticate()

button
         <script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>

claim eth


That doesn’t look like the code for a button.

I have the same error. I used the vue starter template and the problem arises when I refresh the page, the user stays “logged in” but the calls to the contracts not going trough. Calling await Moralis.enableWeb3() before the executeFunction doesn’t solve the issue. In that case it says:

TypeError: Cannot read properties of null (reading ‘on’)

when i put await Moralis.authenticate() before the executeFunction it works but that brings up the authentication page after each refresh.

any idea how to keep the user “really” authenticated?

FYI: when i try to access moralis.User.current() after refresh it logs the user for me, however the _localId field is undefined and when I log the user after authentication that field is not present.

maybe this error is related to recent update to the sdk: Moralis JS-SDK v1.0.0 [beta] (Ethers.js support)

Ive used that same video but I keep getting the error: moralis.js:t (in promise) Error: Missing web3 instance, make sure to call Moralis.enableWeb3() or Moralis.authenticate()

I’m new to coding. Can you explain where and how I should call Moralis.enableWeb3() Where should it appear in the code?