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
Full-static generated site 404 & then accessing asyncdata #7648
Comments
Hi @bstrdChronicles Thank you for taking the time to write this bug report with the explanations.
This is normal
Actually this is because it hits the SPA fallback, nice catch, I just created #7657 to fix this :)
This is normal SPA fallback behaviour since it can exists on the API but not re-generated yet. |
Hey Sébastien (@Atinux) :) no problem, i really enjoy Nuxt - so want to help however I can. Thanks for the Fix guys! :) What would be the best way to stop the last behaviour in static production mode on pages I like, to not call the API, as I do not want people to know where my data is in some cases. |
@bstrdChronicles you can use in if (!process.dev && process.static) {
return
} Before calling your API, it should do the trick :) |
@Atinux hmmm tried it with process.static -> but that would also not allow it in the export/generation step :) Any idea how I could solve that? :) |
I forgot using if (!process.dev && process.client && process.static) {
return
} |
@Atinux haha yeah true, should have thought of that. Thanks Sébastien!! |
You are welcome :) |
Reproduction
First of all let me praise you for the awesome full static mode. Although there are still a few minor things its an awesome addition!
Now to the misbehaviour :) :
my config:
Steps to reproduce
If you got a link somewhere to a page that is not generated, you will get 404 errors trying to fetch a payload for that page.
Seen here:
https://st.immospotter.at/components
You open the page and you will get errors for /components/media as this page does not exist yet but the link is pointing there.
Now if you go to
https://st.immospotter.at/components/media
Of course you would get a 404, but you get:
1 x 404 error for the page itself.
1 x 404 error for the try to fetch a payload for a non existing page.
1 x He still tries to do the request to fetch the data from the api, which ofc as the page doesnt exist results in another 404
What is Expected?
I am not expecting errors trying to fetch payloads of non existing pages.
I am only expecting 1 x 404 Error when i try to access the non existing page in this case /components/media.
I am expecting that he does not try to still do the api call - as he shouldnt do that anymore in full static mode as far as I understood :)
What is actually happening?
see Reproduction.
The text was updated successfully, but these errors were encountered: