title: Cloud Functions: Promises must be handled appropriately
body: <p>Since I upgraded Cloud Functions for Firebase to Node8 and ES17 a TsLint error shows up when trying to update a function. It throws <code>Promises must be handled appropriately</code> for this chunk of code:</p>
  
  <pre><code>app.get('*', (req, res) =&gt; {
      const isBot = detectBot(req.headers['user-agent']);
  
      if (isBot) {
          const botUrl = generateUrl(req);
          // If bot, fetch url via rendertron
          fetch(`https://foo.com/render/${botUrl}`)
              .then(rendertronRes =&gt; rendertronRes.text())
              .then(body =&gt; {
                  res.set('Cache-Control', 'public, max-age=300, s-maxage=600');
                  res.set('Vary', 'User-Agent');
  
                  res.send(body.toString());
              });
      } else {
          // Not a bot, fetch the regular Angular app
          fetch('https://bar.com/')
              .then(regularRes =&gt; regularRes.text())
              .then(body =&gt; {
                  res.send(body.toString());
              })
              .catch(err =&gt; res.send(err));
      }
  });
  </code></pre>
  
  <p>The strangest part is that it complains about the second fetch, but not the first.</p>