Reputation: 29
Module not found: Can't resolve '@emotion/react' in '...\node_modules\@mui\styled-engine'
I got a compilation failed problem for using Material-UI in a ReactJS project
I check the @mui node_modules
folder but can't fix the compilation bug. Anyone who have any idea please share with me.
Upvotes: 1
Views: 7368
Reputation: 81643
Before using MUI, you should skim the installation guide to see if there are any required packages that you might be missing. In v5, MUI drops the JSS styling library (actually just mark it as obsolete and plan to remove it in v6) in favor of emotion as a default styling engine. If you don't use styled-component or any other third-party styling libraries and expect to use MUI right away, you still have to install emotion to use MUI styling API.
npm install @mui/material @emotion/react @emotion/styled
Upvotes: 8