[英]Deployed React App Shows a Blank Page and Console Returns Error 404
I am a beginner in React JS.我是 React JS 的初学者。 I deployed a React app to Github Pages and apparently it was successful, but the site shows only a blank white page.
我将一个 React 应用程序部署到 Github 页面,显然它是成功的,但该站点仅显示一个空白页面。 The console says 'Failed to load resource: the server responded with a status of 404 ()'.
控制台显示“加载资源失败:服务器响应状态为 404 ()”。 I'd appreciate any help with this.
我很感激这方面的任何帮助。 I can't figure out what I'm doing wrong.
我无法弄清楚我做错了什么。 Here is my repo: https://github.com/toyosicodes/memory-game/tree/master/src .
这是我的仓库:https://github.com/toyosicodes/memory-game/tree/master/src 。 The link to the site itself is https://toyosicodes.github.io/memory-game/
该网站本身的链接是https://toyosicodes.github.io/memory-game/
I know questions like mine have been asked;我知道有人问过我这样的问题; I've spent hours poring over them and trying out the recommended solutions, but they haven't worked in my case.
我花了几个小时仔细研究它们并尝试推荐的解决方案,但它们在我的情况下没有奏效。
i apologise if this post isn't perfect - it's my first.如果这篇文章不完美,我深表歉意——这是我的第一篇文章。
I just tried to access your website at https://toyosicodes.github.io/memory-game/ and it seems to be loading fine for me, with the default React template.我刚刚尝试通过https://toyosicodes.github.io/memory-game/访问您的网站,并且使用默认的 React 模板似乎可以正常加载。 Would you try clearing cache or waiting some time for DNS updates.
您会尝试清除缓存还是等待一段时间等待 DNS 更新。 github.io is a little slow for deployments and takes some time for changes to be visible.
github.io 的部署速度有点慢,并且需要一些时间才能看到更改。 I have sometimes waited 30+ minutes for new changes to be visible.
我有时会等待 30 多分钟才能看到新的更改。
If you like speedy deployments, I would recommend using a service like Vercel or Heroku.如果您喜欢快速部署,我建议您使用 Vercel 或 Heroku 之类的服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.