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");

    postsQuery.find()

    .then(() => {

        console.log("Posts loaded successfully");

    })

    .catch(() => {

        console.log("Error loading Posts");

    })

    console.log(postsQuery)

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