-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Static error page (fullstatic or hybrid) #9417
Comments
It's exactly what happened to me, I finally removed my 404.vue page because non-existing pages were not correctly redirected (they were catched up by _slug.vue, which is my template for dynamic pages). So I end up back to the fallback property and client-side API call to fetch my footer data, but it's kind of annoying and I'd like to keep those API calls private if possible |
Hello @vampics ! |
Hello @ClementLmn, Sorry for the late reply. NuxtConfig
Pages - error.vue
Layouts - error.vue
static - .htaccess
Disadvantages/Unsolved problems
Good Luck! |
Hello @vampics ! Thanks a lot for the detailed explanation 👌 |
Same issue, when i want to create an error.vue with a useFetch... if the useFetch in error.vue fails, redirect to error.vue... we can handle error situation in error.vue :( |
Note - the 3.x issue to track is #18718 |
Problem
I've been trying for a few days to generate a fullstatic nuxt build with a 404 page. It seems for me that the most reliable way to do this was only with the fallback site option. My main problem with this fallback option is that the build turns the error page into a complete SPA page (with all client-side store and asyncData requests).
In my case the API of the backend is not public accessible and the page need to be load data for the footer and header via a store. All of these workarounds not working or send request on client-side.
Working with a explicit 404.vue page and not with the error.vue layout brings other problems with the sitemap, statuscodes or urls with i18n. It can be handled, yes, but it shouldnt be such a mess.
Possible Solutions
It would be a nice feature when the error page has only in fullstatic mode features to prerender it without SPA, a static site only for htacess rules like 'ErrorDocument 404 /404.html'.
I understand why it has to be a SPA so it could be an other option to create a hybrid with possibilities to inject data in a render proccess (with nuxtServerInit) and SPA mode.
Thank you :-)
The text was updated successfully, but these errors were encountered: