MUI styles not loaded in production build #13627
Unanswered
kadosh1000
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Not sure if this is the place to post it, but looking for a solution for over a day, couldn't find anything that will help.
We just started building an app using the
create-react-app
using TypeScript, and also using the@mui/material
for our components. Everything works great on dev (react-scripts start
) but once we build the production bundle all styles are not being included.We are using
@mui/material
createTheme to setup the theme and then include it in our index.tsx:Current behavior
Everything works great on dev (
react-scripts start
) but once we build the production bundle (react-scripts build
) all styles are not being included and there are no errors in the console.Here are screenshots from both:
![image](https://private-user-images.githubusercontent.com/2615945/346561995-9fabd97e-fb68-449b-a0f9-e5dafdc637a8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODQ5MDQsIm5iZiI6MTczOTE4NDYwNCwicGF0aCI6Ii8yNjE1OTQ1LzM0NjU2MTk5NS05ZmFiZDk3ZS1mYjY4LTQ0OWItYTBmOS1lNWRhZmRjNjM3YTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMTA1MDA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGZiOTY0NDUxZWVlOWIyMDg5OWE3ZmI2NjI2MzFlYjIwYjYzODNmZDMyMzgzYjlkMzZjNGIyYmUzNzc1MDcxOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.M33eW6CDvCrvXCTVFucCRMuHvCND-O0M5kxgDqUg5tw)
Dev:
Production:
![image](https://private-user-images.githubusercontent.com/2615945/346561161-fbf2b822-e177-4580-ae1b-a52667da2c25.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODQ5MDQsIm5iZiI6MTczOTE4NDYwNCwicGF0aCI6Ii8yNjE1OTQ1LzM0NjU2MTE2MS1mYmYyYjgyMi1lMTc3LTQ1ODAtYWUxYi1hNTI2NjdkYTJjMjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMTA1MDA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGE5ODFiODk4ZDRkNGI5YTg3MjM1NWU1Mjc4Zjg3Nzc4MWY5NDVmZjIzNWE5MTlhZTMwYThlM2MzZjA5NDY0ZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.fP-aFIBWSItFFRp55NzjpcEGL8SGtTWm0AqZSkiyaHI)
Any idea what should I do to have the styles also in the production build?
Beta Was this translation helpful? Give feedback.
All reactions