TypeError: Cannot read property 'attach' of undefined makeStyles.js TypeError: Cannot read property 'attach' of undefined makeStyles.js heroku heroku

TypeError: Cannot read property 'attach' of undefined makeStyles.js


Adding "jss": "10.0.0"to "dependencies": { }fixed the issue for me

--- Updated 30.12.19 ---

"jss" can now be removed,

bug has been fixed in:

"@material-ui/core": "4.8.2",


If you're using yarn like me, then you can solve it by adding a resolutions field to your package.json targeting jss 10.0.0 version.

package.json should look like this:

{  "dependencies": {    "@material-ui/core": "^4.8.1",  },  "resolutions": {    "jss": "10.0.0"  }}

I shared my solution on Github too (and seems it worked for others): https://github.com/mui-org/material-ui/issues/19005#issuecomment-569447204

Please accept the answer if it also worked for you too! :)


In my case it was resolved by removing the Box component.