Skip to content
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

[core] Missing @mui/system dependency with MUI v6 #15267

Open
caelus-dev opened this issue Nov 4, 2024 · 2 comments
Open

[core] Missing @mui/system dependency with MUI v6 #15267

caelus-dev opened this issue Nov 4, 2024 · 2 comments
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module! component: data grid This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes

Comments

@caelus-dev
Copy link

caelus-dev commented Nov 4, 2024

Steps to reproduce

Hello!

I tried to upgrade from MUI v5 to v6. So as the official document stated, I just changed the @mui/material to the newest version and left everything else unchanged.

    "@emotion/react": "*",
    "@emotion/styled": "*",
    "@fontsource/roboto": "*",
    "@mui/icons-material": "*",
    "@mui/material": "^6.1.4",
    "@mui/x-date-pickers": "^7.21.0",
    "react": "^18.2.0",

However after changing the MUI v5 to v6, I got the following error: @mui/system is missing.

[ERROR] Could not resolve "@mui/system/RtlProvider"
[ERROR] Could not resolve "@mui/system"

As @flaviendelangle suggested in another conversation, I checked if the @mui/system is installed with yarn info, and turned out @mui/system is totally missing. The yarn build also confirms the problem:

foo@workspace:. doesn't provide @mui/system (paa105), requested by @mui/x-date-pickers.

I tried yarn explain peer-requirements command, but it says:
command doesn't support this warning type yet

I also tried to clean the yarn cache, delete folders, use other pc but nothing solved the problem.

Current behavior

@mui/system is not installed by "@mui/material": "^6.1.4"

Expected behavior

@mui/system should be installed by "@mui/material": "^6.1.4"

Context

No response

Your environment

No response

Search keywords: dependency @mui/system

@caelus-dev caelus-dev added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 4, 2024
@github-actions github-actions bot added the component: pickers This is the name of the generic UI component, not the React module! label Nov 4, 2024
@LukasTy
Copy link
Member

LukasTy commented Nov 5, 2024

Hello @caelus-dev, are you using yarn >1 with the PnP module resolution mechanism?

This case is listed in their FAQ.

Creating a .yarnrc.yml file with the following contents fixes this issue.

packageExtensions:
  "@mui/x-date-pickers@*":
    dependencies:
      "@mui/system": "*"

We could list our packages in their known list to avoid this manual labor.
https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-extensions/sources/index.ts
WDYT @mui/code-infra?

P.S. This applies to all the packages having the @mui/system peer dependency:
https://github.com/search?q=repo%3Amui%2Fmui-x+%22%40mui%2Fsystem%22%3A&type=code

@LukasTy LukasTy added core Infrastructure work going on behind the scenes component: data grid This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! component: charts This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 5, 2024
@LukasTy LukasTy changed the title Missing @mui/system dependency with MUI v6 [core] Missing @mui/system dependency with MUI v6 Nov 5, 2024
@caelus-dev
Copy link
Author

Hi @LukasTy , thank you for your answer!

are you using yarn >1 with the PnP module resolution mechanism?

Yes, I use yarn 4.1.0 with pnp module, but I also tried the most recent yarn 4.5.1.

Creating a .yarnrc.yml file with the following contents fixes this issue.

The yarn build no longer shows the error, but seems like the @mui/system package is still missing after setting the packageExtensions. Only workaround I found to put @mui/system directly in the packages.json as dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module! component: data grid This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes
Projects
None yet
Development

No branches or pull requests

2 participants