question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MUI installation doesn't work with React 18

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Installation doesn’t work with current React 18.0.0 version using npm. See the error below. The project has been created using the latest create-react-app. Installation works when using yarn.

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: carshop@0.1.0 npm ERR! Found: react@18.0.0 npm ERR! node_modules/react npm ERR! react@“^18.0.0” from the root project npm ERR! peer react@“>=16.8.0” from @emotion/react@11.8.2 npm ERR! node_modules/@emotion/react npm ERR! @emotion/react@“^11.8.2” from the root project npm ERR! peerOptional @emotion/react@“^11.5.0” from @mui/material@5.5.3 npm ERR! node_modules/@mui/material npm ERR! @mui/material@“^5.5.3” from the root project npm ERR! 1 more (@mui/icons-material) npm ERR! 1 more (@emotion/styled) npm ERR! 1 more (@emotion/styled)

Expected behavior 🤔

Component should be installed.

Steps to reproduce 🕹

Steps:

  1. npx create-react-app myproject
  2. npm install @mui/material @emotion/react @emotion/styled

Context 🔦

No response

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: Windows 10 10.0.19044
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (99.0.1150.55)
  npmPackages:
    @emotion/react: ^11.8.2 => 11.8.2
    @emotion/styled: ^11.8.1 => 11.8.1
    @mui/icons-material: ^5.5.1 => 5.5.1
    @mui/material: ^5.5.3 => 5.5.3
    @mui/types:  7.1.3
    @types/react:  17.0.43
    react: ^18.0.0 => 18.0.0
    react-dom: ^18.0.0 => 18.0.0
    typescript:  4.6.3```
</details>

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:32 (7 by maintainers)

github_iconTop GitHub Comments

43reactions
michaldudakcommented, Apr 4, 2022

We are going to release a new version of Material UI later today. It will be possible to use it with React 18.

15reactions
michaldudakcommented, Apr 5, 2022

Almost there… #32131

Read more comments on GitHub >

github_iconTop Results From Across the Web

MUI installation doesn't work with React 18 - Stack Overflow
If you are using react version greater than 17 you must install Material UI (version) v5. Note: if anyhow MUI v5 does not...
Read more >
[Solved]-MUI installation doesn't work with React 18-Reactjs
This is MUI's problem with the new version of react. They are working to release a new version of Material UI. in the...
Read more >
Installation - Material UI - MUI
Install Material UI, the world's most popular React UI framework. Default installation. Run one of the following commands to add Material UI to...
Read more >
How to use material UI with nextjs and react 18 - Medium
Install material UI library. ... In the first step, you install the material UI and help library packages using the one of package...
Read more >
@mui/styles - npm
@mui/styles. You can leverage our styling solution, even if you are not using our components. Installation. Install the package in your project directory ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found