title: What are some easy to use resources and/or techniques for tracking down web javascript errors?
body: <p>I just chased down wrong bugs for quite a while because code like</p>
  
  <pre><code>fetch("./garbage error message.json")
              .then(res =&gt; res.json())
              .then(res =&gt; { resourceLocations = res })
  </code></pre>
  
  <p>gave the error message (firefox browser)</p>
  
  <pre><code>SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
  </code></pre>
  
  <p>The real error was that <code>fetch</code> may have a different local directory than an <code>import * from ...</code> statement in the same file if the file itself is imported.</p>
  
  <p>I've come to realize I waste way too much time on trivial javascript errors, and wanted to ask for ways to remedy that.</p>