【问题标题】:Deploying React in Github page - Failed to load resource: the server responded with a status of 404在 Github 页面部署 React - 加载资源失败:服务器响应状态为 404
【发布时间】:2020-09-12 05:25:37
【问题描述】:

我正在制作 React 应用程序。


首先,我正在使用 SASS 在 GH 页面上进行部署,现在我遇到了这个问题。谁能告诉我如何解决这个问题?

我不知道具体需要添加哪些代码,所以请告诉我需要添加的代码部分。

page with error

【问题讨论】:

标签: css reactjs webpack sass


【解决方案1】:

我认为您应该在 package.json 中设置主页属性

阅读:https://create-react-app.dev/docs/deployment/#building-for-relative-paths

这是因为您的网站不在域的根目录下。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-30
    • 2016-11-01
    • 2018-01-29
    • 2020-07-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多