【发布时间】:2021-01-25 04:51:18
【问题描述】:
我在使用 Svelte 时遇到错误,导致无法在 GitHub 页面上托管的网站上加载 bundle.js、bundle.css、global.css 和 favicon.png。
我已通读this question,但该问题在其他浏览器上仍然存在,没有任何 VPN、干净的 Firefox 配置文件或没有扩展,并且似乎是接受文件内容类型的问题。
Firefox 控制台中的错误信息是:
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 <script> with source “https://path/to/bundle.js”
GET https://path/to/favicon.png [HTTP/2 404 Not Found 7ms]
带有favicon.png 的响应和请求标头:
// 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/"5f4de496-313"
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
其他响应头都显示text/html的内容类型类型,尽管它们都不接受text/html。
我在 gh-pages 分支上使用 GitHub 页面,我可以确认文件存在。如果这是 GitHub 页面或 Svelte 的问题,我正在措辞,以及我可以做些什么来修复/防止这个问题在未来发生。
如果需要,这里是the code,可以通过https://kitchefs.github.io/beta访问网站。
【问题讨论】:
标签: github-pages svelte