Skip to content
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

False positives with MUI library #13

Open
SLMNBJ opened this issue Dec 15, 2023 · 4 comments
Open

False positives with MUI library #13

SLMNBJ opened this issue Dec 15, 2023 · 4 comments

Comments

@SLMNBJ
Copy link

SLMNBJ commented Dec 15, 2023

I'm using Next.js (v13 with pages directory) with the MUI library. In the case of error Hydration, it's hard to debug compared to native modal error and seems not to have the same value.
Here is an example. I just added Math.random()

Screen Shot 2023-12-15 at 21 26 40 Screen Shot 2023-12-15 at 21 26 48
@samijaber
Copy link
Contributor

It looks like MUI renders inline styles in SSR, but uses classnames in CSR, which causes this mismatch. Not sure how to approach hiding these false positives... 🤔

@samijaber samijaber changed the title Hydration diff with MUI library False positives with MUI library Jan 2, 2024
@samijaber
Copy link
Contributor

Actually: could you provide the full diff here? Before and After?

It looks like the left side has a big Emotion <style> tag: we could potentially remove those from the SSR to simplify things...although the hydration mismatch could potentially be IN the emotion tag too 😅

@SLMNBJ
Copy link
Author

SLMNBJ commented Jan 2, 2024

Here is the BUILDER_HYDRATION_OVERLAY object. BUILDER_HYDRATION_OVERLAY object.json

If the problem is with the emotion tag, I should have the problem first too, right?

@samijaber
Copy link
Contributor

If the problem is with the emotion tag, I should have the problem first too, right?

If by "first" you mean "before using this hydration overlay", then no. The reason we get false positives is explained here: https://github.com/BuilderIO/hydration-overlay/?tab=readme-ov-file#caveats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants