Theme empty on ssr #391
Labels
customization: theme
Centered around the theming features
package: system
Specific to @mui/system
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
I'm working on the migration of an app in a Turborepo the was built with MUI 5 + Emotion + NextJS. I migrated 99% of the app but I'm getting a few errors in a few occasions.
I've tried to replicate all of them in a Codesanbox, tbh I'm not sure if I'm doing something wrong myself or if I'm missing some steps somewhere as I think these errors are triggered by a normal use of the app so I suppose people would already have flagged them, but I can't see what's wrong in this setup
Steps to reproduce
I've updated the codesandbox:
https://codesandbox.io/p/devbox/pcq54p
there is now an initial page that links to the issues:
Issue 1 - sx props not working correctly
Open url: https://codesandbox.io/p/devbox/pcq54p/issue-1 and remove:
the app will break, you will not be able to see the update and if you refresh the app will not load
Issue 2 - Props + theme not working together
Open url: https://codesandbox.io/p/devbox/pcq54p/issue-2 and remove the comment from:
refresh the page and you will see the app broken
Issue 3 - empty theme on SSR (useMediaQuery)
Open url: https://codesandbox.io/p/devbox/pcq54p/issue-3 and update this line:
to be:
Issue 4 - Render a simple stack from
@mui/material-pigment-css/Stack
Open url: https://codesandbox.io/p/devbox/pcq54p/issue-4 and replace
with
the app will crash.
Issue 5 - Can't style mui table
Open url: https://codesandbox.io/p/devbox/pcq54p/issue-5
The
TableCell
color is not appliedIssue 6 - I'm asked to install
@emotion/server
I suppose this should be installed as part o pigment or the documentation should be updated to warn about this.Expected behavior
The app shouldn't crash with in these cases
Your environment
npx @mui/envinfo
Search keywords: theme ssr sx
The text was updated successfully, but these errors were encountered: