title: SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
body: <p>On sending an HTTP DELETE request from my Angular front-end to my Node back-end, the following error is thrown:</p>
  
  <p><a href="https://i.stack.imgur.com/VD3N9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VD3N9.png" alt="Syntax Error"></a></p>
  
  <p>However the DELETE request still gets processed and the object deleted.</p>
  
  <p>Here's my delete function in Angular:</p>
  
  <pre class="lang-js prettyprint-override"><code>  deleteProject(id: number) {
       this.http.delete(`projects/${id}`).subscribe(
        response =&gt; {
          this.toastr.success('Project deleted.', 'Success');
        },
        err =&gt; {
          console.log(err);
        }
      );
    }
  </code></pre>
  
  <p>And in my back-end API:</p>
  
  <pre class="lang-js prettyprint-override"><code>function remove(req, res) {
  
    let query = {
      _id : req.params.id
    };
  
    Projeto.findById(query)
    .then(async (projeto) =&gt;  {
  
      if(!projeto) {
        return res.status(404).json({error: 'not_found', message: 'This project doesn\'t exist.'});
      }
  
      if(projeto.project_manager.toString() != req.user._id.toString()) {
        return res.status(403).json({error: 'forbidden', message: 'You can\'t delete this project.'});
      } else {
        await Projeto.findByIdAndRemove(query);
      }
  
  
      res.status(200).send("Project deleted.");
  
  
    })
    .catch(utils.handleError(req, res));
  }
  </code></pre>
  
  <p>What does that error refer to and how can I fix it?</p>