-
Notifications
You must be signed in to change notification settings - Fork 9
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
This Suspense boundary received an update before it finished hydrating #35
Comments
Seconded. Here is video of the error, and then when I comment out I think it's worth noting that we are still using the |
Hey all! Sorry for the inconvenience. Can you please provide us a simple replication repository to dig into this? Thanks for your help! |
I could give you temporary access to our repo potentially, but I don't have time to spend debugging this honestly. I can note some things we use: React Query, pages directory, styled-components, dynamic imports, etc. you can see in my shared video above that it is most definitely the SpeedInsights component causing the hydration error. I'm assuming it's the Suspense component being used within pages directory, as I've ran into that before. |
Is there a bare minimum codesandbox for the pages directory? I am only seeing a codesandbox for the app router. Going to try and get something together because I am tired of seeing this issue. Edit: please link it if there is |
This was fun lol, spent all day trying to replicate by creating a small reproduction of our site in totality and by removing items from our build one by one to find a root cause. Found the culprit in our case, a hook we used that didn't handle an effect properly. Really wish the error had more info to deduce this easier, but glad to have figured it out! Sorry for the noise here. |
this is happening to me as well: i'm getting the error message, and poking around the call stack reveals it occurs when rendering i'm willing to accept that it might be caused by some other code, but speed insights is certainly a catalyst in some way |
my app seems to change props.route rapidly on load, which triggers this effect:
i believe if that effect was a transition instead (or additionally), it would make react chill out a bit i'm still investigating why app.route changes so often... |
the other patch that might fix it for me (my two
it might also resolve it to wrap that in a check
or you could put that check here:
|
I'm having the same issue but I can't reproduce it, it occurs only at times as I found it in our logs. Is there any solution for this? Additional information:
|
Same issue for me with Next 14 and pages. |
Hey all. We were also facing the same issue with pages router in Something like this. export default function MyApp({ Component, pageProps }) {
return (
<>
<Providers>
<Layout>
<Component {...pageProps} />
</Layout>
</Providers>
<SpeedInsights />
</>
);
} Hope this helps someone. |
Even moving Moving EDIT: I managed to track down where the issue originated; as others have pointed out, it had to do with "bad effects". In this case, we accessed a global store in |
In my case, the problem was that the App component was wrapped in |
When adding
<SpeedInsights />
component to our Next.js application, we receive this error on Sentry and locally:This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.
The text was updated successfully, but these errors were encountered: