Getting error while trying to get the data from the collection

Why is this getting me parse error? is there something wrong in the syntax? Iā€™m trying to get the data from the collection.

Error: You need to call Parse.initialize before using Parse.

const postsQuery = new Moralis.Query("Posts");


    .then(() => {

        console.log("Posts loaded successfully");


    .catch(() => {

        console.log("Error loading Posts");



most of the time this error is because Moralis.start was not used and serverUrl and appId were not set