Error: You need to call Moralis.start with an applicationId before using Moralis

Im following the netflix-clone tutorial with moralis, react and Web3UIKit and in the part where we can fetch data from the database to see myList in our Home.js component in the use effect, i got this error message in the console: “Error: You need to call Moralis.start with an applicationId before using Moralis”.


This is the error in the console


This is my index.js file


This is where I think the error occurs

You can use const { isInitialized } = useMoralis() and set that in your useEffect to only run fetchMyList if (isInitialized) is true.

In your example, it will run even if account isn’t valid e.g. null, so likely before the server connection has happened.

Thats worked. Thank you so much!
This is my new useEffect


It works if a have a wallet connected to the app, but when I disconnect it, then i got this error message in the console “POST https://ybzr5krvwptp.usemoralis.com:2053/server/users 400” and i cant connect it again. I have to delete my new attribute myList in the database to connect a wallet.

How are you disconnecting? Do you get any error when you try and connect again?

also from which table ?

With a connectButton from the Web3UIKit. Yes I get the error that I mentioned in the previous post

From the user class. I create a new attribute call myList to store an array of movies, and then make a request from the client to fetch the data

I create a new attribute call myList to store an array of movies

Your fetchMyList will run if Moralis has initialized even if account isn’t valid e.g. switches from a valid address to null, this would explain the POST error.

You can add && account to your if statement for running fetchMyList(), you should also add isInitialized to your useEffect dependencies.

I tried, but the error still persist. I have to delete the colum created in the user class to connect the wallet again.

I create a new attribute call myList to store an array of movies

Are you not updating the attribute? So you’re creating it and then you’re trying to create it again. Can we see this code. I would think getMyList should only read data or this list.

I have this cloud function that reads data from the database but can update data too


And this is the array attributtes that i create in the database

Ok, I imagine if you were to put a button in your frontend that calls this cloud function separately, the same error will happen without connecting/disconnecting the wallet, given that you need to delete the column to get it working again.

You should also look at separating out your cloud functions e.g. when user connects, getMyList only reads the list.

I am calling this cloudFunction on the useEffect hook and it supposed to be trigger only if there is an Authenticated user and an account. How could I fix that?

Not sure what you mean, getMyList will only work when the user is valid as it requires the address or addrs. That should be fine.

I mean, how can I separate out my cloud function to only call getMyList when user connects.

You can make a cloud function that only gets the list or edit your existing one. And then use another cloud function for updating.

You can check the user object in request parameter from that cloud function. In case that it helps you.

I tried this but I still get the POST error and I can’t reconnect the wallet to the app.
This is my cloudFunction to fetch data from the myList array attribute


And this is the cloudFunction to update the myList array on the database: