-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Drawers demo error Uncaught TypeError: Cannot read property '@global'
#8652
Comments
There is no Sorry, but I have no clue. I can't help without a reproduction example. |
In case anyone else has similar issues... |
I have the same problem but your solution doesn't work for me... I"ll try to create a small example |
Ok the problem is basically the following : you have a const style = theme => ({foo:null}); Then it causes the problem |
Following @clementblaudeauEarthCube 's hint on malformed objets, I tried the following: const styles = theme => {
return {
toolBar: {...theme.mixins.toolBar},
drawerPaper: {
width: drawerWidth,
[theme.breakpoints.up("md")]: {
position: "relative"
}
},
content: {
flexGrow: 1,
backgroundColor: theme.palette.background.default,
padding: theme.spacing.unit * 3,
},
}
}; I'm using create-react-app, so object-rest-spread is enabled by default. This workaround helped for me. But I have no clue as to why theme.mixins.toolBar doesn't return a proper object. |
I also ran into this bug. In my case, this happend, as I linked a lib, which is developed by myself into an existing project with |
I have faced this issue too last week at the office. It was linked to a theme issue between two versions of Material-UI installed. I had to inject the right theme in the React tree. I have opened an issue on JSS side: cssinjs/jss#899. |
@oliviertassinari How did you inject the right theme in the React tree? I've run into the same issue. I'm pulling Material UI version 3.3 and a dependency is pulling 1.3.1. |
@AmineS Use the theme provider. |
Thanks Olivier! |
@oliviertassinari I occurred this problem those days, and And I saw issue cssinjs/jss#899 is marked solved, but they recently released is alpha, is there a plan Thank you very much, for your work!! |
Trying the Drawer examples causes an error:
This seems to be caused by
drawerHeader: theme.mixins.toolbar,
in thestyles
definition (works if I take that one out).I do have a provider at root:
Your Environment
The text was updated successfully, but these errors were encountered: