title: "Loading failed for the <script>" 404 Error - Svelte
body: <p>I am having an error with Svelte that prevents the loading of <code>bundle.js</code>, <code>bundle.css</code>, <code>global.css</code> and <code>favicon.png</code> on a website hosted on GitHub pages.</p>
  <p>I have read through <a href="https://stackoverflow.com/questions/45879671/only-on-firefox-loading-failed-for-the-script-with-source">this question</a> but the issue persists on other browsers, without any VPN, a clean Firefox profile or no extensions, and seems to be an issue with the acceptance of the content-type of the files.</p>
  <p>The error message in the Firefox console is:</p>
  <pre><code>GET https://path/to/global.css    [HTTP/2 404 Not Found 9ms]
  
  GET  https://path/to/bundle.css   [HTTP/2 404 Not Found 9ms]
  
  GET https://path/to/bundle.js     [HTTP/2 404 Not Found 7ms]
  
  Loading failed for the &lt;script&gt; with source “https://path/to/bundle.js”
  
  GET https://path/to/favicon.png   [HTTP/2 404 Not Found 7ms]
  </code></pre>
  <p>And the Network tab returns:
  <a href="https://i.stack.imgur.com/HbRhW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HbRhW.png" alt="network tab" /></a></p>
  <p>With the response and request headers for <code>favicon.png</code>:</p>
  <pre><code>// Request
  
  GET /favicon.png HTTP/2
  Host: kitchefs.github.io
  User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0
  Accept: image/webp,*/*
  Accept-Language: en-GB,en;q=0.5
  Accept-Encoding: gzip, deflate, br
  Connection: keep-alive
  Referer: https://kitchefs.github.io/beta/
  TE: Trailers
  
  // Response
  
  HTTP/2 404 Not Found
  content-type: text/html; charset=utf-8
  server: GitHub.com
  strict-transport-security: max-age=31556952
  etag: W/&quot;5f4de496-313&quot;
  access-control-allow-origin: *
  content-encoding: gzip
  x-proxy-cache: MISS
  x-github-request-id: EAA2:03EC:1BFD04:221937:5F816340
  accept-ranges: bytes
  date: Sat, 10 Oct 2020 07:39:07 GMT
  via: 1.1 varnish
  age: 475
  </code></pre>
  <p>The other response headers all show the content-type type of <code>text/html</code>, despite all of them not accepting <code>text/html</code>.</p>
  <p>I'm using GitHub pages on a <code>gh-pages</code> branch, and I can confirm that the files exist. I'm wordering if this is an issue with GitHub pages or Svelte and what I can do to fix/prevent this problem from occuring in the future.</p>
  <p>If required, here is <a href="https://github.com/Kitchefs/beta" rel="nofollow noreferrer">the code</a> and the website can be accessed at <a href="https://kitchefs.github.io/beta" rel="nofollow noreferrer">https://kitchefs.github.io/beta</a>.</p>