-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github pages 404 error on static files first time #4115
Comments
@peduarte I think your error looks different, could you open a separate issue? @subsid Changing your <a href={withPrefix("/notes/probability.html")} target="_blank">Probability</a> I think the Note that I get slightly different results using your site - in development mode clicking a link to one of the notes gives me a 404 error: |
@m-allanson Hey 👋 Thanks for your suggestion, I'm going to give it a try. I was under the impression In my case I am actually using Do you think this could be the issue? |
@m-allanson Sure! |
Thanks :) |
@m-allanson thanks for looking into it. Changing it to an The error seems like, my gatsby-config is not respecting the link to be a client only route. Actually the page opens, and then github's 404 shows up. (If you hit back on the 404 page, it goes to the notes file). Also, if I open the link manually in a new tab, it works fine. https://subsid.github.io/notes/probability.html Its only clicking on the link that causes the issue. Regarding your local setup, hmm, not sure why that would happen. The file is present in |
@m-allanson I was able to recreate the issue you had locally. The first time I cloned the repo, started server and clicked the link, I got the gatsby-404 page. But on subsequent clicks, it works fine. But if I delete |
Huh... ok! I'm not sure exactly what's happening under the hood, but I managed to work around this with these steps:
Does that fix it on your side? If you're able to do some more digging into the source of the problem that'd be very useful! |
I'm glad you got it working! |
I faced the almost same problem, and I fixed it by editing It was very helpful for me to read docs of sw-precache because |
I'm also facing the same issue, my question is how do you handle the already existing service worker to fix this issue or force refresh to update the changes. @ykosaka-welyco when you updated |
@pedrouid I'm facing the same issue. Have you been able to find a solution? |
I have removed the service-worker completely and unregistered the existing ones |
FWIW: not using It seems to occur because link clicks are hijacked by the router (which is fine) and subsequently When going there directly, there is no link click to be hijacked, and the gatsby router resolves correctly. |
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open! |
not stale
…On Sat, 19 Jan 2019, 18:16 gatsbot[bot], ***@***.***> wrote:
Old issues will be closed after 30 days of inactivity. This issue has been
quiet for 20 days and is being marked as stale. Reply here or add the label
"not stale" to keep this issue open!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB35WJepN3LdQ5tlc6H4NRcSj-LS6g4gks5vE1MLgaJpZM4SJiys>
.
|
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
This is a mistake.. |
@SleeplessByte Did you figured out how to solve this issue? I am facing the same problem on production. |
@SleeplessByte I can't. I don't see the button reopen privileges |
@SleeplessByte I added target="_blank" and href to http instead of https. It used to give 404 on primerlabs.io, but worked well on www.primerlabs.io. Now, it's working fine for both. |
I am new to gatsby and facing an issue with loading static html files.
I have a component called
notes.js
that links to some static files like soThe file is saved at
static/notes/note1.html
.This works fine in development,
http://localhost:8000/notes/note1.html
opens as expected when I click on the link.But when I deploy the same, the first time I click on the link, it goes to github's 404 page.
But works fine on subsequent clicks.
Have I misconfigured something in gatsby?
gatsby repo: https://github.com/subsid/blog-skeleton
Thanks for your great work.
The text was updated successfully, but these errors were encountered: