【问题标题】:gh-pages displaying a blank page instead of project pagegh-pages 显示空白页面而不是项目页面
【发布时间】:2019-12-13 04:09:34
【问题描述】:

我正在尝试部署我的第一个 react 应用程序,并按照下面的链接将其部署在 gh-pages 上。使用 Git Bash 时,假设它有效,我没有收到任何错误消息。但是,当我通过设置打开链接时,它只显示一个空白页面。我究竟做错了什么?提前谢谢你。

这是我的存储库的链接:https://zerhar.github.io/todo-app/

如何将 React 应用部署到 Git Hub 页面的链接:https://facebook.github.io/create-react-app/docs/deployment#github-pages-https-pagesgithubcom

【问题讨论】:

    标签: reactjs git github github-pages


    【解决方案1】:

    如果我“查看源代码”https://zerhar.github.io/todo-app/ 我看到 JavaScript script 标记没有指向正确的路径。

    例如,这里是链接到this dead link 的脚本标签之一:

    <script src="/Zerhar/todo-app/static/js/2.15fea075.chunk.js">
    

    需要调整,所以链接变成this

    <script src="/todo-app/static/js/2.15fea075.chunk.js">
    

    我不太确定script 标签的设置位置,因为我没有看到它们列出here,但这是首先要尝试修复的问题。

    【讨论】:

    • 我尽力调整它,但正如你所说,找不到脚本标签。我会继续尝试找到调整它的方法。
    • 我想我终于找到了我的问题的答案。显然 .scss 文件是导致我问题的原因。我将其更改为普通的 .css 文件,问题就消失了。感谢您的回复。
    猜你喜欢
    • 2022-11-26
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 2017-02-18
    • 2017-03-31
    • 2017-11-13
    • 2023-03-17
    • 2013-11-17
    相关资源
    最近更新 更多