It says it to all moralis properties.
I already installed Moralis Snippets and used ânpm install moralisâ.
What do I do?
I am also trying to follow and old tutorial, is it why its showing the error?
Please provide more reference to what youâre trying to achieve. Screenshot and the steps youâve taken to install the packages. It will help us catch the error faster.
I was following the how to clone rarible on youtube, when I try to use the functions that moralis has it shows me this, every word with 3 dots under shows that error.
Hey @Francisco
Ignore this. It tells you this because web3 is not a standard window object property.
I did, but when I try to run the app (first time launching the server exactly as shown in the first tutorial of the how to clone rarible) instead of showing me what the tutorial shows (if it was runing properly) it tshows both buttons(the hide element isnât working) and the buttons donât work.
I though it was because of that problem.
Now I open the console and it says âUncaught ReferenceError: require is not definedâ on top of the application id.
What do I do?
Try to add to the top of your code:
const Moralis = require('moralis');
now if I use âconst Moralis = require(âmoralisâ);â it shows the same erroe, but with out it, like I had before its working, but the same problem as before apear.
Try Moralis.Web3, if I remember correctly
On latest versions of the SDK for activating web3 you need to use window.web3 = await Moralis.enable();
Now I get âTypeError: Cannot read properties of undefined (reading âauthenticateâ)â on the try catch block in the code and
Basically the tutorial is to old and I need to read the docs and figure out right?
Do you guys intend to make another how to clone rarible or opensea in the future?
Thanks for the help here!
Please help I have the exact same issue with the exact same words âMoralis.initializeâ I tried everything mentioned in this post but literally none worked.
Hi,
Can you post your entire code?
Moralis.initialize(âchsq9Snf5cP87ThamdobAZBUhoyWIdFuX5RVsRIPâ);
Moralis.serverURL = "https://bspz2lfp1lyx.bigmoralis.com:2053/server";
let homepage = "http://127.0.0.1:5500/index.html";
if (Moralis.User.current() == null && window.location.href != homepage) {
document.querySelector('body').style.display = 'none';
window.location.href = "index.html";
console.log("Not so fast!");
}
login = async () => {
await Moralis.authenticate().then(async function (user) {
console.log("logged in");
user.set("name", document.getElementById('user-username').value);
user.set("email", document.getElementById('user-email').value);
await user.save();
window.location.href = "Dashboard.html"})}
logout = async () => {
await Moralis.User.logOut();
window.location.href = "index.html"};
if(document.querySelector('#btn-login') != null){
document.querySelector('#btn-login').onclick = login;}
if (document.querySelector('#btn-logout') != null){
document.querySelector('#btn-logout').onclick = logout;}`Preformatted text`
I mean entire HTML + javascript code that you would expect to work.
"<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Hugo 0.88.1">
<title>Login Component</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.1/examples/sign-in/">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="signin.css">
<link rel="stylesheet" href="style.css">
<img class="mb-4" src="CryptoSimplified Pic.png" alt="" width="92" height="67">
<h1 class="h3 mb-3 fw-normal">Please sign in</h1>
<div class="form-floating">
<input type="text" class="form-control" id="user-username" placeholder="BigMan450?">
<label for="user-username">Username</label>
</div>
<div class="form-floating">
<input type="email" class="form-control" id="user-email" placeholder="[email protected]">
<label for="user-email">Email address</label> </div>
<button id="btn-login" class="w-100 btn btn-lg btn-primary" type="submit">Sign In</button>
<p class="mt-5 mb-3 text-muted">© 2017â2021</p>
"Preformatted text
I donât see in this HTML something like:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/moralis.js"></script>
I have a similar issue. Followed a Moralis tutorial for a dApp that signs a user in, signs with MetaMask then showcases userâs blockchain activity. The blockchain info (transactions, balances, etc) wonât populate, and Moralis admin doesnât show the username and email. Triple checked my code, have snippets, cdn, etc but I keep getting these errors