-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Compatibility issues with Remix #44993
Comments
Updates: swapping react dependencies to canary versions remove that hydration issue and solve the contained/text issue, but shows a different error: -"react": "^18.2.0",
-"react-dom": "^18.2.0"
+"react": "18.3.0-canary-01ab35a9a-20240228",
+"react-dom": "18.3.0-canary-01ab35a9a-20240228", New hydration error
|
After more testing, the only way to have it barely functional was to add
But this results in extreme slowness ~35 seconds to render a page. Is the answer that MUI doesn't work with Vite/Remix and we should wait until "true ESM Support"? |
Hey @davidbielik, thanks for reaching out. May I ask you to test this resolution on your package.json: "resolutions": {
"@mui/material": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/material",
"@mui/material-pigment-css": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/material-pigment-css",
"@mui/private-theming": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/private-theming",
"@mui/styled-engine": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/styled-engine",
"@mui/styles": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/styles",
"@mui/system": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/system",
"@mui/types": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/types",
"@mui/utils": "https://pkg.csb.dev/mui/material-ui/commit/8a28484f/@mui/utils",
}, And removing the This is to test if #43264 would fix it. |
Hi @DiegoAndai thanks - here's the result.
|
And what do you get when adding: // vite.config.ts
ssr: {
noExternal: [
/^@mui\/icons-material/
]
} |
That works, though just adding mui increases load time from < 50m up to ~10 seconds, even in a production build. The only thing I've added was MUI |
Ok, so it seems this would be fixed by #43264. Thanks for the quick response. May I ask you to do a final test with: "resolutions": {
"@mui/material": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/material",
"@mui/material-pigment-css": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/material-pigment-css",
"@mui/private-theming": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/private-theming",
"@mui/styled-engine": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/styled-engine",
"@mui/styles": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/styles",
"@mui/system": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/system",
"@mui/types": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/types",
"@mui/utils": "https://pkg.csb.dev/mui/material-ui/commit/2422d845/@mui/utils",
}, And no |
empty
Still ~4 seconds + hydration error
|
I created a repro: https://github.com/DiegoAndai/material-ui-issue-44993-repro There's definitely something not working, I'll continue investigating |
Steps to reproduce
Steps:
npx create-remix@latest remix-mui-bug
npm install @mui/material @emotion/react @emotion/styled
<Button>
Current behavior
Hydration errors (and also for some reason the button converts from
variant="contained"
tovariant="text"
upon hydration?)Expected behavior
I should be able to
npm install
mui and not have hydration errorsContext
I followed the advice here: #39765 by adding this provider but still seeing the error
Your environment
npx @mui/envinfo
Search keywords: remix Warning: Prop
charSet
did not match. Server: "null" Client: "utf-8" Error Component StackThe text was updated successfully, but these errors were encountered: