在github上发布React应用程序后获取空白页 [英] Getting blank page after react app publish in github

查看:170
本文介绍了在github上发布React应用程序后获取空白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的步骤是:
npm run build

My steps are: npm run build

然后

主页: https://parthaaaaa.github.io/firstwebapp /

predeploy: npm run build,

"predeploy": "npm run build",

deploy : package.json 文件中的 gh-pages -d build

"deploy": "gh-pages -d build" in package.json file

然后

npm install --save-dev gh-pages

npm install --save-dev gh-pages

然后

在Github存储库中。.
我选择了 gh pages分支。*

In Github repository.. I selected "gh pages branch.*

最后,

npm运行部署

但是我得到一个空白页
应用程序运行良好

but I'm getting a blank page app runs fine in local host..

帮助。

推荐答案

在您的主机中package.json 主页不正确,因此使构建混乱。
更改

In your package.json homepage is not correct, so it is messing up the build. Change

  "homepage": "https:Parthaaaaa.github.io/firstwebapp",

  "homepage": "https://parthaaaaa.github.io/firstwebapp",

然后尝试再次构建和部署。

Then try building and deploying again.

建立相对路径

这篇关于在github上发布React应用程序后获取空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆