title: HttpErrorResonse Unexpected token S in JSON at position 0 Firebase
body: <p>I'm using google firebase cloud functions.</p>
  
  <p>When accessing my cloud function from client, I get the below HttpError </p>
  
  <pre><code>SyntaxError: Unexpected token S in JSON at position 0
      at JSON.parse (&lt;anonymous&gt;)
      at XMLHttpRequest.onLoad (http://localhost:4200/vendor.js:13445:51)
      at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:13121:35)
      at Object.onInvokeTask (http://localhost:4200/vendor.js:71621:33)
      at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:13120:40)
      at Zone.runTask (http://localhost:4200/polyfills.js:12888:51)
      at ZoneTask.invokeTask [as invoke] (http://localhost:4200/polyfills.js:13203:38)
      at invokeTask (http://localhost:4200/polyfills.js:14361:18)
      at XMLHttpRequest.globalZoneAwareCallback (http://localhost:4200/polyfills.js:14398:25)
  
  text: "Sended"
  </code></pre>
  
  <p>Below is my server code,</p>
  
  <pre><code>exports.sendMail = functions.https.onRequest((req, res) =&gt; {
    cors(req, res, () =&gt; {
        .....
        return transporter.sendMail(mailOptions, (erro, info) =&gt; {
          if (erro) {
            return res.send(erro.toString());
          }
          return res.send('Sended');
        });
      })
    });
  
  });
  </code></pre>
  
  <p>Please tell me what i'm doing wrong here ?</p>