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
[Id] SSR – Mismatched server / client ids when running in StrictMode
#811
Comments
StrictMode
StrictMode
Thought some more about this and then it struck me that of course this would be a problem, the implementation is proven non-deterministic in concurrent mode which is why So then I thought about how might we solve for this and I kept ending up back in the same place – wouldn't it be easier to just not do this on the server in the first place? I did some digging and turns out Reach has been down this rabbit hole already and written a nice piece of documentation on it. https://github.com/reach/reach-ui/blob/develop/packages/auto-id/src/index.tsx While this is a warning and not a "today" problem, it will become a bigger issue in the future so the question is whether we'd want to take a similar approach here / now. Worth noting that I did check in on other popular implementations and they suffer from the same issue. |
StrictMode
StrictMode
Any updates on this? We just ran into the same issue |
Not since my follow up, one workaround is disabling This issue isn't exclusive to Radix, it exists in many other |
Yeah, I created an issue in react-spectrum (adobe/react-spectrum#2231) for react-aria to see how they react and what ideas they might have as well. Thanks for the quick response @andy-hook - and yes, I did exactly that 😅 strictMode disabled for now |
Seeing the same issue as a |
Any updates on this? It's a super annoying error 😅 |
My logs gets filled up with this |
I agree that this warning is not ideal but our options to resolve it without compromise are limited. In order to deal with this today we’d likely need to render id’s on the client only, this has performance and a11y consequences. Once stable our best bet will be useOpaqueIdentifier. For now disabling |
So I've disabled |
@ashtonlance Have you tried upgrading all of your radix-ui packages to latest? |
I have. Everything is up-to-date including Stitches. These are the UI packages I'm using.
|
Strange 🤔 my only other suggestion is to try nuking |
@andy-hook tried that and still getting the same console errors. |
@ashtonlance sorry to hear this, I can't reproduce on my end. Do you have a public project I could take a look at? |
@andy-hook I have a vercel staging url I can share! unless you need the source code -- that repo is private but I could add you as a user. |
same issue here, bug with tooltip component |
@ashtonlance If you could add me that'd be great. |
Same issue for me, and I'm using the Dialog components. |
Added. Thanks for taking a look! |
Possible react-18 solution? |
@coderinblack08 Yep, that is the renamed |
For anyone late to the party dropping in from Google, not able to upgrade to React 18 yet, |
@ajrussellaudio If you are able to upgrade to the latest versions of the primitives, the |
Awesome @jjenzz thanks! |
@ajrussellaudio how are you able to determine which elements require the |
@daniellizik By manual process of elimination, commenting out components until the error disappears and following the tree down. But as @jjenzz points out, this fix is no longer needed if you upgrade your radix primitives dependency. |
Problem reappeared, using react: 18.2.0, next: 13.4.12 with app router, @radix-ui/react-dialog. Error: app-index.js:31 Warning: Prop Any ideas for a fix besides setting a custom value in aria-controls? |
@DennieMello Can you check if this is an issue on the Next.js side? #1684 (comment) |
Thanks, fixed in next: "13.4.13". |
Related #793
Original report via Discord:
https://codesandbox.io/s/radixui-idprovider-ssr-mismatch-i3o1x
This is reproducible in our current SSR testing app since
StrictMode
was added in #795Wrapping
React.StrictMode
or settingreactStrictMode: true
innext.config
is equivalent afaik.The text was updated successfully, but these errors were encountered: