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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTU4NjEsIm5iZiI6MTczOTU5NTU2MSwicGF0aCI6Ii8yNjE1OTQ1LzM0NjU2MTk5NS05ZmFiZDk3ZS1mYjY4LTQ0OWItYTBmOS1lNWRhZmRjNjM3YTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDQ1OTIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTMxN2RjZWVmODkwNDIxMmMxZjcwOWFkNzBjMTZjODA4ZDExNGJmZTY5MzZhN2FmMjMxNWU1YmVkY2UzMGE3ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.sCiQRUcGmUMNoyVeYnLCSQvplDEnDh-xOmO2aP0-H70)
Dev:
Production:
![image](https://private-user-images.githubusercontent.com/2615945/346561161-fbf2b822-e177-4580-ae1b-a52667da2c25.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTU4NjEsIm5iZiI6MTczOTU5NTU2MSwicGF0aCI6Ii8yNjE1OTQ1LzM0NjU2MTE2MS1mYmYyYjgyMi1lMTc3LTQ1ODAtYWUxYi1hNTI2NjdkYTJjMjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDQ1OTIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmQwYTE2NGE5NjYyMDk2YTIxNjRlYzE3OWJiOTViZjNlM2ViZTU3YjhjZjJhYzYxMGQ2OGVlNWVkMjZjZjMyYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.4DrlB0vJQ4UYHC3k6oK7FkJ7GHW2-WTaRfS_MvgcZiM)
Any idea what should I do to have the styles also in the production build?
Beta Was this translation helpful? Give feedback.
All reactions