简体   繁体   English

部署的 React 应用程序显示一个空白页面并且控制台返回错误 404

[英]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.

相关问题 Angular / Ionic应用程序显示空白页,控制台中没有错误 - Angular/Ionic app shows blank page and no error in the console firebase 部署和托管 React App 时获取空白页面 - Getting blank page when React App is deployed and hosted by firebase create-react-app 部署在 Heroku 但页面为空白 - create-react-app is deployed on Heroku but page is blank 将 React 应用发布到 Github 页面但显示空白页面 - Publish React App onto Github Page but Shows Blank Page Github 页面在部署反应应用程序后显示空白页面 - Github Pages shows blank page after deployment react app Create-React-App在WHM / cPanel服务器上显示空白页 - Create-React-App shows blank page on WHM/cPanel server 使用React / Laravel应用刷新页面中断应用返回空白页面 - Refreshing page with React/Laravel application breaks app returns blank page 使用 Webpack 和 Babel 在网站上部署应用程序时出错(显示空白页) - Error deploying app on website with Webpack and Babel (shows blank page) 在 Netlify 上部署 React 应用程序返回 404 页面未找到 - Deploying React app on Netlify returns 404 page not found Github页面上的Create-React-App返回一个空白页面 - Create-React-App on Github-pages returns a blank page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM