MUI causing Hydration issues with simple styling. Remix:vite 2.7.2 #8913
Replies: 9 comments 23 replies
-
Was the previous working version also on Vite? Or did you just switch to Vite as of Remix v2.7.2? |
Beta Was this translation helpful? Give feedback.
-
The previous working version was not Vite. I switched to Vite as of Remix v2.7.2 coming from 2.6.2. Using Hydration fallback I managed to get a page to render, however, I feel like that is just a bandaid over a larger problem. I don't think I should need that on every page. Additionally I am also getting some wrangler error messages that are preventing some pages from working. They may be unrelated and an additional issue to resolve after the page can render successfully. |
Beta Was this translation helpful? Give feedback.
-
Having the same issue. Checkout the Codesandbox The entry.client.tsx / entry.server.tsx / root.tsx code is copied from the official mui-remix-example. I compared the html generated in entry.server.tsx with the one displayed in the browser and it's identical (obviously ignoring the codesandbox script). |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Many projects and companies rely on mui. This makes it impossible to use remix vite in these contexts. |
Beta Was this translation helpful? Give feedback.
-
I've created a sample repo showing Remix+MUI+Vite ⚡️ StackBlitz |
Beta Was this translation helpful? Give feedback.
-
I have created an example repo here Tested on node 20.11.1 |
Beta Was this translation helpful? Give feedback.
-
I am also experiencing this hydration error, even with |
Beta Was this translation helpful? Give feedback.
-
Have we found a solution for this? We started building with Remix, Vite, and MUI, and are now completely dependent on the app. The app has grown, and this hydration issue is killing our productivity. |
Beta Was this translation helpful? Give feedback.
-
This is still a problem as of today. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have recently upgraded to remix:[email protected] using vite. This has broken every single page when using MUI. It appears to be caused by any styling added to the MUI components using the sx prop, possibly others as well.
e.g. The below example as an index page will cause the following errors
src:
error 1:
error 2:
If I change the index to simply be a Box without the styling prop, the page renders error free.
This issues only appeared after updating the remix:run 2.7.2 (with cloudflare pages) and node 20.11.1. It was not present on 2.6.x and node 18.17.x
Any help to diagnose and fix the issue would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions