-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Defer breaks on hydration error #9576
Comments
Context: #5165 (comment)
|
Would it be possible to make this break more visible and clear, indicating what just happened? Currently, it just stops working without any error, warning, or indication. |
Since the hydration error only occurs on full document requests, perhaps Remix should include something in the initial context to indicate a deferred promise is in process. If the client re-renders before the promise is resolved, assume something went wrong and revalidate the page. This will trigger the loader again and should work this time as it's now a client navigation. |
Reproduction
This is a stackblitz where I am forcing a hydration error. As you can see, the deferred data never resolves.
If the hydration error is fixed, deferring starts working again.
https://stackblitz.com/edit/mosattler-remix-repro-defer-search-params-njpsxx?file=app%2Froutes%2F_index.tsx
System Info
Used Package Manager
npm
Expected Behavior
defer should still work, even when hydration errors are happening. They can easily be missed, and sometimes there is nothing a developer can do to prevent them (e.g. the user is using Adblocks)
Actual Behavior
defer
breaks on hydration errorsThe text was updated successfully, but these errors were encountered: