-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Material UI v6 + Remix + Vite running with “Prop className
did not match” error
#43980
Comments
Same here. My workaround (only works for v6.1.2, not for v6.1.1) is to update ssr: {
noExternal: [process.env.NODE_ENV === 'development' ? '@mui/icons-material' : /^@mui\//],
}, In my case, |
Hey @onozaty, thanks for the report, and sorry for the late reply. I'm unable to run your repro. May I ask you to provide further details (maybe a video) on how to run it? I'm stuck so far as I'm unclear where I should run Thanks @s-hashimo for chiming in, about your investigation:
could you provide a minimal repro of the behavior you're experiencing? This would help debug whatever is happening. |
Thanks for replying. 😃 Here is my minimal? repro: https://github.com/s-hashimo/remix-vite-mui And here are the commands to reproduce: npm i
npm run dev
It's based on the following two packages:
I suppose that the |
Hey @onozaty, thanks for the repro. I spent some time debugging this, but unfortunately, I still haven't figured out what's happening. I checked that the className mismatch warning also happens when using We've had similar issues with next: #29428 I'm not seeing this error in our Remix example: https://github.com/mui/material-ui/tree/master/examples/material-ui-remix-ts, so if it's a possibility for you to start using that, then it might help. It might also help to compare with your current setup. If you confirm that this is also happening in v5, I think we can accept the issue as a remix integration improvement. |
Thank you for working on this issue.
This did not occur in v5.16.7.
This example provided by MUI does not use Vite. The templates provided by Remix use Vite, and it is common practice to use Vite. Thanks. |
Steps to reproduce
Execute the following repository,
Steps:
npm run dev
Current behavior
The following will appear in your browser's console
Expected behavior
Expect no errors in the browser console.
Context
This did not occur with Material UI v5.
The code for v5 is as follows.
When I upgraded from Material UI v5 to v6, I initially got the following error with
npm run dev
.To avoid this, the following settings are added in
vite.config.ts
.Now the screen itself can be displayed, but there is an error in the browser console.
Your environment
npx @mui/envinfo
Search keywords: Remix Vite
The text was updated successfully, but these errors were encountered: