title: Getting "TypeError: Failed to fetch" when the request hasn't actually failed
body: <p>I'm using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API" rel="noreferrer">fetch API</a> within my React app. The application was deployed on a server and was working perfectly. I tested it multiple times. But, suddenly the application stopped working and I've no clue why. The issue is when I send a <code>get</code> request, I'm receiving a valid response from the server but also the fetch API is catching an exception and showing <code>TypeError: Failed to fetch</code>. I didn't even make any changes to the code and it's the issue with all of the React components.</p>
  <p>I'm getting a valid response:</p>
  <p><a href="https://i.stack.imgur.com/bIITr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bIITr.png" alt="enter image description here" /></a></p>
  <p>But also getting this error at the same time:</p>
  <p><a href="https://i.stack.imgur.com/8NUNH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8NUNH.png" alt="enter image description here" /></a></p>
  <pre><code>fetch(url)
  .then(res =&gt; res.json())
  .then(data =&gt; {
    // do something with data
  })
  .catch(rejected =&gt; {
      console.log(rejected);
  });
  </code></pre>
  <p>When I remove credentials: &quot;include&quot;, it works on localhost, but not on the server.</p>
  <p>I tried every solution given on StackOverflow and GitHub, but it's just not working out for me.</p>