MUI + Vercel => different CSS applied

When I use npm run dev to develop my website - my css is applied "as intended" - and I have styled my MUI-components to match my needs. However, when I push it to Vercel, it seems that the custom MUI-classes, gets added last (even though the order in class='' is the same). When rendered on Vercel, MUI-classes are the last classes in the cascade (viewed in Inspector), where as when rendered locally, MUI-classes are soms of the first in the cascade - this getting overwritten. This results in drastic different results on dev and prod. How can i make sure the behaviour is the same ?
6 Replies
deforestor
deforestor•2y ago
Does it not happen if you build locally? I mean, I'm assuming that by "local", you meant running dev
_tweak^prone
_tweak^proneOP•2y ago
Hi deforstor; great question, for some reason i didnt test that - i will test it right away @deforestor Quite right - next build followed by npm run start seems to product the same problems.
deforestor
deforestor•2y ago
Well that's perfect, easier to debug if it's local Are you using tailwind with MUI or not?
deforestor
deforestor•2y ago
GitHub
material-ui CSS styles not applied when running in production mode ...
Bug report Describe the bug Used the material-ui Next.js starter https://github.com/mui-org/material-ui/tree/master/examples/nextjs, and wrote an app. The app works fine when running with yarn dev,...
deforestor
deforestor•2y ago
Interesting... Try this If that works, this really seems to be a weird behavior on next's part
_tweak^prone
_tweak^proneOP•2y ago
@deforestor im using it with Tailwind 🙂 I will try.
Want results from more Discord servers?
Add your server