Comments (7)
Don't put 404.html in the build directory. This repo runs the live demo site - use its structure as a reference.
from spa-github-pages.
Hi
Sorry, I changed it and I still have the same problem, I'm thinking maybe this is not working?
Thanks
from spa-github-pages.
Nope, the example site works fine. Issue is on your end.
Read the GitHub docs https://help.github.com/categories/github-pages-basics/ the instructions here are not a substitute for the github docs.
My suggestion would be to clone this repo and follow the detailed instructions to get the example site working with your account before making any changes to the code and content.
from spa-github-pages.
I'm not saying your app doesn't work, however, your code is not working my app, since I got 404 from Github and the same error before I add your code.
from spa-github-pages.
It sounds like you're having an issue with loading a custom 404 page.
https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/
Make sure 404.html
is present in the root of the branch that is being served by GitHub pages, which in your case should be the gh-pages
branch - that's where GitHub pages will look for a custom 404 page, if it doesn't find it it will serve it's standard 404 page, which I think is what's happening.
from spa-github-pages.
Also, if you're using it with a project pages site without a custom domain, i.e. https://ptchiangchloe.github.io/portfolio-site, make sure to set segmentCount = 1
here so /portfolio-site
will remain in the path after the redirect.
from spa-github-pages.
It looks like you're using the gh-pages npm package to create your gh-pages branch from your master branch. In this case you need to have the 404 file in the public directory on your master branch so it ends up in the root of your gh-pages branch.
For someone who is starting out my suggestion would be to use as little tooling as possible to really understand what's happening so you don't run into issues like this one, and then slowly add more tooling. That is, just create your site in the gh-pages branch and not use the gh-pages npm package. Tooling is great, but can cause a lot of frustrating issues if you're a beginner and don't understand what it's doing.
from spa-github-pages.
Related Issues (20)
- Redirect script link typo HOT 1
- about.html HOT 4
- Refreshing the page still throws a 404 error in the console. HOT 3
- Doesn't work with Next.js HOT 4
- How to inject environmental variables into 404.html? HOT 4
- Just saying thanks
- ? mark not being removed HOT 1
- No longer working for SEO purposes? HOT 2
- ['] being converted to [%27] and breaking React Router HOT 1
- Redirect stays on /?/ HOT 1
- React-router params HOT 2
- Bundle.js file isn't my build folder HOT 1
- Possible to have dynamic social media cards? HOT 1
- Shows a blank page on a route with a path of 2 hashes or more
- Update README for further clarification of instructions
- Mention alternative of `HashRouter` HOT 5
- Consider add GitHub Actions Support?
- Suggestion - Avoid 404's using meta tag HOT 2
- Assets 404 not found with Vite + React Router
- Getting infinite redirect? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spa-github-pages.