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