title: Fetch in React adds localhost before the url
body: <p>I'm using fetch to read some data with a GET request.</p>
  <p>Something like this:</p>
  <pre><code>  fetch(
      'myurl.com/data',
      requestOptions
    )
      .then((response) =&gt; response.text())
      .then((result) =&gt; console.log(result))
      .catch((error) =&gt; console.log('error', error));
  </code></pre>
  <p>I've tested it in postman and it works fine, it returns the data.</p>
  <p>The problem is when I call it in browser, it returns an HTML instead of JSON.</p>
  <p>In Dev Tools -&gt; Network -&gt; Initiator the url appears different, it adds at the beginning of it &quot;localhost...&quot;</p>
  <p>Like this:  <code>http://localhost:3000/store/orders/myurl.com/data</code>. And because of this the url is broken and it doesn't return the JSON.</p>
  <p>There is no <code>http://localhost:3000/store/orders</code> in the project, it is in <strong>package.json</strong> this line: <code>&quot;homepage&quot;: &quot;/store/orders/&quot;</code>.</p>
  <p>Is there a way to solve this issue?</p>