Parse.User.logIn() throwing error ParseError: Received an error with invalid JSON from Parse: Cannot POST /parse/login

I have been struggling with this issue for a while. This is part of a more complex system that I did not create. SignUp works, however, logIn does not. I stripped it down to a simpler approach to minimize possible problems while troubleshooting.

This is what is inside my controllers/login.js file

const signinAuth = (Parse) => async (req, res) => {
   var user = new Parse.User();
   user.set("username", "[email protected]");
   user.set("password", "password01");

 //This part I used to test signUp in the simplest way possible. IT WORKS and can see it in dashboard.
   user.signUp().then(function success(user) {
    console.log("Signed up ", user);
   }, function error(err) {

    try {
      const user = await Parse.User.logIn("[email protected]", "password01");
      res.status(200).json({ message: 'Login successful', user: user });
    } catch (error) {
      console.error('Error during login:', error);
      res.status(500).json({ error: 'Login failed', details: error.message });

The error I am given is the following:

Error during login: ParseError: Received an error with invalid JSON from Parse: Cannot POST /parse/login

    at handleError (D:path\WebPage\node_modules\parse\lib\node\RESTController.js:301:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:path\WebPage\controllers\login.js:102:20 {
  code: 107

I tried the following, and it worked for me. Here’s the code snippet I used for your reference:

(async () => {
  const user = new Parse.User();
  user.set('username', '[email protected]');
  user.set('password', 'password01');

  try {
    let userResult = await user.signUp();
    console.log('User signed up', userResult);
    try {
      // Pass the username and password to logIn function
      let user = await Parse.User.logIn('[email protected]', 'password01');
      // Do stuff after successful login
      console.log('Logged in user', user);
    } catch (error) {
      console.error('Error while logging in user', error);
  } catch (error) {
    console.error('Error while signing up user', error);