Moralis MetaMask Sign in not opening or initializing

Been trying to get this marketplace to work. Following the tutorial and not being able to populate an NFT. If I understood correctly, the marketplace is suppose to automatically open the MetaMask signing popup, so the user can sign before seeing any contents on the marketplace? But that’s not happening. Attached is the screenshot of the marketplace code. What’s wrong here?

Hope you got Moralis.start({ serverUrl, appId }) to initialize moralis before the authenticate function ?
You can aslo try add .catch(error) => console.log(error) after your .then to check for possible errors.

Thanks for the response. Yes I have that “initialize moralis start…” part done.

Do I have to create a “login button” and implement a login code? I am under the impression this code “moralis.authenticate…” will automatically open the MetaMask login pop-up window whenever a user visits the marketplace site.

Or am I under the wrong impression?

You need a at least a button to trigger that or something else, but make sure the authenticate function is below the initialization as I see in the screenshot above, it’s on the second line

thank you for the response… on the button part, I thought so… I suppose the negligence caused because I was following this code by Moralis and there was no code part for the button creation…

I will have to implement that

I see you’re using Moralis.initialize which is deprecated. Here is a fix to that That needs to be fixed first

I am using the new code (see screenshot). The same coding I used in creating the NFT mint page and it works for that. However using same code for the NFT Marketplace and I cannot get it to work…

You mentioned implementing a button, do you mind telling me where I should place the button code? As you can see in the tutorial there was no mention of the button and no button code implemented either.