[英]A problem with publishing a react app to github with gh-pages
我已根據 Create React App 中的指南使用 gh-pages 將我的 React 應用程序發布到 github。 這是我的存儲庫的鏈接: https : //github.com/ozhey119/RallyTrip 。 我的應用程序沒有路由,所以我不明白問題出在哪里。
當我訪問我發布的網站時,我只能看到一個白頁,以及控制台中顯示的一些錯誤:
Failed to load resource: the server responded with a status of 404 ()
2.fd66cf29.chunk.js:1 Failed to load resource: the server responded with a status of 404 ()
main.23425634.chunk.js:1 Failed to load resource: the server responded with a status of 404 ()
manifest.json:1 Failed to load resource: the server responded with a status of 404 ()
manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.
main.df77a612.chunk.css:1 Failed to load resource: the server responded with a status of 404 ()
這可能聽起來很俗氣,但您的回購名稱案例是導致問題的原因。 如果你打開下面的兩個鏈接,你會看到不同之處,
https://ozhey119.github.io/RallyTrip/favicon.ico
https://ozhey119.github.io/rallytrip/favicon.ico
因此,在https://github.com/ozhey119/RallyTrip/blob/master/package.json#L4 中,您可以將主頁更改為https://github.com/ozhey119/RallyTrip
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.