You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React JS应用部署到Netlify/Render/GH Pages显示空白,本地正常

React应用本地运行正常,部署到Netlify/Render/GitHub Pages后显示空白

我被这个问题困扰了两周,尝试了多种修复方案但均无效。我的React JS应用在本地服务器运行完全正常,但部署到Netlify、Render以及GitHub Pages后页面显示空白。

相关信息:

  • GitHub仓库:new-bnb-lab
  • Render部署后效果:Render部署后空白页面
  • 本地运行效果:本地运行正常页面

我尝试过的修复操作:

  • 修改package.json,添加部署脚本:
"scripts": {
  "predeploy": "npm run build",
  "deploy": "gh-pages -d build"
}
  • 先后设置homepage字段为:
    • "https://bilguun1130.github.io"
    • "https://bilguun1130.github.io/new-bnb-lab"

但以上操作都没能解决问题,页面仍然显示空白。

内容的提问来源于stack exchange,提问作者realibgun

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 17:38:13