Fallback to server navigation when fetching on the client navigation fails #53064
Replies: 4 comments 1 reply
-
This totally makes sense to me 🙂 Would it make sense to make it optional somehow? I'm thinking of a form doing a POST request. If I understood this correctly, if the server returns an error, it would load the gray screen with just messages like "Error: Please fill the required fields". I could imagine block developers wanting to handle those errors themselves and maybe create a new |
Beta Was this translation helpful? Give feedback.
-
Yes. I want to explore POST requests with @DAreRodz today, specifically for the Comments Form. I think those need to be some sort of controlled navigation requests, where the response is not displayed directly, but passed instead to a callback that can decide what to do. |
Beta Was this translation helpful? Give feedback.
-
We also need to add a timeout so if the |
Beta Was this translation helpful? Give feedback.
-
I think we can close this one now. @DAreRodz opened a PR to add the timeout, and the |
Beta Was this translation helpful? Give feedback.
-
I was thinking that, instead of figuring out how to report and deal with client-side navigation errors, the client router should just fall back to server-side navigation when something went wrong. As long as the HTML remains our API and the URL remains our source of truth, it should be simple and safe in 100% of the cases. So if something goes wrong again during the server navigation (maybe the user still doesn't have an Internet connection), the browser will show them the proper error.
Opinions?
Beta Was this translation helpful? Give feedback.
All reactions