Error: Can't resolve '@mui/styled-engine'
See original GitHub issueBecause of the hard github templates I almost forgot to say: Thank you so much for all the hard work on this library! I’m coming from a few different design-systems and I really love the components and api of mui! ❤️
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
After following the installation guide, when starting the app I’m getting following errors.
ERROR in ../../node_modules/@mui/system/esm/index.js 1:0-88
Module not found: Error: Can't resolve '@mui/styled-engine' in 'node_modules\@mui\system\esm'
I’m using styled-components but also tried temporarily adding emotion to my project which seems to work fine. I have followed the styled-engine-sc
guide carefully but the error sticks around.
I’m using CRA with lerna and yarn workspaces. The styled-engine
folder does appear in the root node_modules folder but for some reason, it can’t be resolved.
Also tried deleting all packages in node_modules
and reinstalled multiple times.
Expected behavior 🤔
No errors
Steps to reproduce 🕹
Couldn’t find a way to reproduce this in a codesandbox yet but judging from the closed issues https://github.com/mui-org/material-ui/issues/28559 and https://github.com/mui-org/material-ui/issues/27846, some people that were commenting there were running into similar issues.
Your environment 🌎
`npx @mui/envinfo`
System:
OS: Windows 10 10.0.22000
CPU: (12) x64 AMD Ryzen 5 5500U with Radeon Graphics
Memory: 3.06 GB / 15.35 GB
Binaries:
Node: 16.8.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.21.0 - C:\Program Files\nodejs\npm.CMD
Managers:
pip3: 20.2.3 - C:\Python39\Scripts\pip3.EXE
Utilities:
Git: 2.31.1.
SDKs:
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.17763.0
IDEs:
VSCode: 1.63.2
Languages:
Python: 3.9.2
Databases:
PostgreSQL: 13.3 - C:\Program Files\PostgreSQL\13\bin\postgres.EXE
Browsers:
Chrome: 97.0.4692.71
Monorepos:
Yarn Workspaces: 1.22.10
Lerna: 4.0.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:10 (2 by maintainers)
Top GitHub Comments
Do not do
package.json
dependencies resolutions step, or it will cause your content of./node_modules/@mui/styled-engine
to bestyled-engine-sc
package.package.json
Just do
webpack.config.js
andtsconfig.json
part.https://github.com/mui/material-ui/issues/27846
This is still happening… wondering where the problem is…
I have styled-engine folder under node_modules/@mui (and the engine is styled-compoennt-sr) I saw it working when changed styled-engine version to a different one (from 5.3.0 to latest) But after reinstalling all again (because I watend to see if it was working correctly) then it started to fail again