Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material UI styles broken in production build #3173

Closed
tlvince opened this issue Sep 22, 2017 · 10 comments
Closed

Material UI styles broken in production build #3173

tlvince opened this issue Sep 22, 2017 · 10 comments

Comments

@tlvince
Copy link

tlvince commented Sep 22, 2017

Is this a bug report?

No(?)

Can you also reproduce the problem with npm 4.x?

Yes

Which terms did you search for in User Guide?

  • material ui
  • build
  • minify
  • jss

Environment

  1. node -v: v6.11.3
  2. npm -v: 5.4.2
  3. npm ls react-scripts: 1.0.7

Then, specify:

  1. Operating system: Linux
  2. Browser and version: Chrome v61

Steps to Reproduce

  1. Include a component that uses Material UI via npm
  2. Run npm run build
  3. Check build output

Expected Behavior

Styles (of the included component) to match what they look like in development (npm start):

image

Actual Behavior

Styles are mangled/page layout broken:

image

Reproducible Demo

https://github.com/tlvince/tlvince-reduced-test-case-material-ui-cra


The issue can be worked around by including the component under src (rather than within node_modules). It appears that something in CRA's production build is breaking the layout/mangling the styles.

@Timer
Copy link
Contributor

Timer commented Sep 22, 2017

Ah, this is no good!

Could you please try to figure out what's causing this and put together a pull request to fix this behavior?

A reproducible demo would be useful, too.

@tlvince
Copy link
Author

tlvince commented Sep 22, 2017

I will continue debugging this. In the meantime, here's a reduced test case: https://github.com/tlvince/tlvince-reduced-test-case-material-ui-cra

@tlvince
Copy link
Author

tlvince commented Sep 22, 2017

Ah, this appears to be a manifestation of mui/material-ui#8223; see my update here mui/material-ui#8223 (comment). Feel free to close this issue.

@dqhuy78
Copy link

dqhuy78 commented Jul 16, 2018

@tlvince I have run into the same problem and wonder have you solved it ??

@bugzpodder
Copy link

@dqhuy78 please file a new issue.

@AnisDerbel
Copy link

same here

@sanzhardanybayev
Copy link

The same problem. Haven't you already solved this issue?

@Bambirrar
Copy link

same here!

@AnisDerbel
Copy link

I ended up to remove material-ui-pickers and that solve the problem

@facebook facebook locked as off-topic and limited conversation to collaborators Sep 27, 2018
@gaearon
Copy link
Contributor

gaearon commented Sep 27, 2018

Going to lock because I saw no evidence this is related to Create React App.
If you believe it is (e.g. this problem doesn't occur in other environments) please file a new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants