Makestyles "You have to import it from @mui/styles" error when doing just that
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
I’m getting the error
MUI: makeStyles is no longer exported from @mui/material/styles.
You have to import it from @mui/styles.
But i’m already doing that. there is no instance of any material/styles
in my code, only @mui/styles
.
for example one of the erroring files starts like this:
import { ReactElement } from "react";
import { makeStyles } from "@mui/styles";
const useStyles = makeStyles({
...
Expected behavior 🤔
I don’t receive an error.
Steps to reproduce 🕹
Cannot create repro steps
Context 🔦
No response
Your environment 🌎
`npx @mui/envinfo`
System:
OS: macOS 12.0.1
Binaries:
Node: 14.17.0 - ~/.volta/tools/image/node/14.17.0/bin/node
Yarn: 1.22.5 - ~/.volta/tools/image/yarn/1.22.5/bin/yarn
npm: 6.14.13 - ~/.volta/tools/image/node/14.17.0/bin/npm
Browsers:
Chrome: 99.0.4844.51
Edge: Not Found
Firefox: Not Found
Safari: 15.1
npmPackages:
@emotion/react: 11.8.1
@emotion/styled: 11.8.1
@mui/base: 5.0.0-alpha.71
@mui/icons-material: 5.5.0
@mui/material: 5.5.0
@mui/private-theming: 5.4.4
@mui/styled-engine: 5.4.4
@mui/styles: 5.5.0
@mui/system: 5.5.0
@mui/types: 7.1.2
@mui/utils: 5.4.4
@types/react: ^17.0.38 => 17.0.38
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: ^4.3.5 => 4.5.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
makeStyles is not longer exported from @mui/material/styles ...
Even I am importing from @mui/styles all over in my project but still it is showing this error. I removed node_modules and reinstalled...
Read more >Troubleshooting - Material UI - MUI
This error arises because makeStyles is now exported from the @mui/styles package, which does not know about Theme in the core package. To...
Read more >Visual issues of React Material UI after migrating from v4 to v5
Importing makeStyles from two different places means that we are using two different versions of it, from two different versions of Material UI....
Read more >Module not found: Error: Can't resolve '@mui/styles' Material UI
Module not found: Error : Can 't resolve '@ mui/styles ' Material UIPlease do like share and comment if you like the video...
Read more >Migrate Material-UI 4 to Mui-5 - DEV Community
now we need to import it to entry point like where you're wrapping ... another solution to migrate the makeStyles to styled using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got it, thanks!
@mnajdova don’t you need to use
import { createTheme } from '@mui/material/styles';
? How would you do this without getting theError: MUI: makeStyles is no longer exported from @mui/material/styles.
error?