You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described in this discussion thread, the request headers are not available on an error page. Therefore, cookies are not available either. So this code on a ~/error.vue page yield both null values. I am using server-side rendering.
I completely understand the use case. The only question here is about caching, as if we pass headers, then we can't cache the error page result. (@pi0 - what do you think?)
While I understand the less dependencies for error page does make sense especially if the error is a more "deep/core error", there are situations we just wanna do a 404 error and have everything under control. In my site at least, I do want to still show the user on the header and the headers being missing messes it up. Why not add an option for soft non-cachable errors?
Describe the feature
As described in this discussion thread, the request headers are not available on an error page. Therefore, cookies are not available either. So this code on a
~/error.vue
page yield both null values. I am using server-side rendering.I can imagine that it would be really useful to have this information available on an error page.
A potential "fix" could be easily implemented by passing the request headers to the
$fetch
function on this line:Additional information
Final checks
The text was updated successfully, but these errors were encountered: