title: Fetch API (Javascript) Works Only When Debugged (Breakpoints)
body: <p>I am attempting to retrieve JSON from an external source -  Open Weather Map and I'm using the Javascript Fetch API to generate the request. I should be returned the current weather at a location via JSON that I can parse from the Open Weather Map API. When I'm debugging my applications and I have breakpoints on the fetch statement the request is sent and I receive a prompt response from the API. After I remove the breakpoints I receive the following message from the Firefox Developer Edition console <code>TypeError: NetworkError when attempting to fetch resource.</code>, the Google Chrome console doe not log an error but I can see that a new network request was not generated.</p>
  
  <pre class="lang-js prettyprint-override"><code>const submitButton = document.querySelector('.submit-zip-button');
  const APIKEY = 'REDACTED';
  
  function parseWeather(currentWeather){
      let currentTemp = currentWeather.main.temp;
      let currentWeatherDescription = currentWeather.weather[0].description;
      let weatherIconCode = currentWeather.weather[0].icon;
  }
  
  function getWeather(zipNum){
      let weatherData = new Object();
  
      fetch(`https://api.openweathermap.org/data/2.5/weather?zip=${zipNum},us&amp;units=imperial&amp;appid=${APIKEY}`)
          .then(response =&gt; response.json())
          .then(data =&gt; {
              console.log(data);
              weatherData = data;
              parseWeather(weatherData);
      });
  }
  
  submitButton.addEventListener('click', function(event){
      event.stopPropagation();
      let zipcode = document.querySelector('#zipcode-input');
      zipcode = Number(zipcode.value);
      getWeather(zipcode);
  
  </code></pre>
  
  <p>Does anyone have any tips or material I can read to better understand what's going on? I've read the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" rel="nofollow noreferrer">Fetch MDN Page</a> and used their example code as the basis of my fetch function. </p>