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

[docs] Fix peer dependency range #15281

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Nov 5, 2024

I noticed this in https://www.npmjs.com/package/@mui/x-charts, it's a turn-off for adopting the lib. This was forgotten in #14142.

Off-topic. we might miss React 19 here in the peer dependency, needed to use Next.js 15.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work docs Improvements or additions to the documentation labels Nov 5, 2024
@mui-bot
Copy link

mui-bot commented Nov 5, 2024

Deploy preview: https://deploy-preview-15281--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 2fac339

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix, thanks for spotting it. 👍

Off-topic. we might miss React 19 here in the peer dependency, needed to use Next.js 15.

This is a separate topic. We need to unblock the @types/react bumping first. 🤔

@leonardolombardi07
Copy link

Hi! This means that we cant' use mui-x with Next.js 15?
I updated my Next app from version 14 to 15 and MUI from version 5 to 6.
But I couldn't install @mui/x-data-grid

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Nov 5, 2024

@LukasTy Ah right, I forgot #13356.

Proposing this for the next company product meeting https://www.notion.so/mui-org/product-Company-Product-Meeting-2024-11-18-135cbfe7b66080518203cff028b28579?pvs=4#135cbfe7b660810eba5ed10342dac778.

This means that we cant' use mui-x with Next.js 15? I updated my Next app from version 14 to 15 and MUI from version 5 to 6. But I couldn't install @mui/x-data-grid

@leonardolombardi07 You should be able ot install @mui/x-data-grid, there is no conflict in https://unpkg.com/[email protected]/package.json. What you experienced is likely unrelated.

Can people use MUI X with Next.js 15 today? Yeah, kind of. I have just tried and didn't see any obvious problems. But until we run all the tests with React 19, we have to fix bugs as people report them, we are a bit blind.

@oliviertassinari oliviertassinari merged commit 36b13d8 into mui:master Nov 5, 2024
18 checks passed
@oliviertassinari oliviertassinari deleted the fix-dependency-readme branch November 5, 2024 23:21
@marketsystems
Copy link

@LukasTy Ah right, I forgot #13356.

Proposing this for the next company product meeting https://www.notion.so/mui-org/product-Company-Product-Meeting-2024-11-18-135cbfe7b66080518203cff028b28579?pvs=4#135cbfe7b660810eba5ed10342dac778.

This means that we cant' use mui-x with Next.js 15? I updated my Next app from version 14 to 15 and MUI from version 5 to 6. But I couldn't install @mui/x-data-grid

@leonardolombardi07 You should be able ot install @mui/x-data-grid, there is no conflict in https://unpkg.com/[email protected]/package.json. What you experienced is likely unrelated.

Can people use MUI X with Next.js 15 today? Yeah, kind of. I have just tried and didn't see any obvious problems. But until we run all the tests with React 19, we have to fix bugs as people report them, we are a bit blind.

I upgraded from next 14 to 15 using their codemods script.. and it throws a bunch of peer dependency errors from mui-x-data-grid..I can obviously override them (probably) or just ignore.

NextJs15 requires react 19 and mui data grid allows 18, its spits errors like below (and also about react_dom 19)

@mui/x-data-grid@"^7.22.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR! peer react@"^17.0.0 || ^18.0.0 || ^19.0.0" from @mui/[email protected]
npm ERR! node_modules/@mui/system
npm ERR! peer @mui/system@"^5.15.14 || ^6.0.0" from @mui/[email protected]
npm ERR! node_modules/@mui/x-data-grid
npm ERR! @mui/x-data-grid@"^7.22.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Nov 6, 2024

@marketsystems Right, this makes sense. It's about #13356. For now, you can force the conflict of peer dependencies.

@LukasTy
Copy link
Member

LukasTy commented Nov 6, 2024

@oliviertassinari @marketsystems
It's strange, am I missing something or Nextjs 15 upgrade guide states they only support React 19, but given their package.json they also support ^18.2. 🤔
I have whipped up a project using @mui/material@6, @mui/x-data-grid@7, [email protected], and [email protected] and haven't experienced any problems.
The installation passes and app is running fine. 🤷

@oliviertassinari
Copy link
Member Author

@LukasTy This should be clearer: https://x.com/olivtassinari/status/1849418686962061769

@marketsystems
Copy link

@marketsystems Right, this makes sense. It's about #13356. For now, you can force the conflict of peer dependencies.

forcing peer dependencies did work for me i still got a bunch of errors from all different packages but I just added to the overrides nextjs has already hacked into the package.json and copied in react and react dom versions it had installed: Its not great but it appears to work temporarily. Really depends I guess how long until react 19 actually has a proper stable version!!

"overrides": {
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
}

@marketsystems
Copy link

@oliviertassinari @marketsystems It's strange, am I missing something or Nextjs 15 upgrade guide states they only support React 19, but given their package.json they also support ^18.2. 🤔 I have whipped up a project using @mui/material@6, @mui/x-data-grid@7, [email protected], and [email protected] and haven't experienced any problems. The installation passes and app is running fine. 🤷

yep was about to reply same, page router can be compatible but app router not.. Personally I dont see why anybody should be making new projects with pages router, understandably some may have old projects with pages router though

@LukasTy
Copy link
Member

LukasTy commented Nov 6, 2024

This should be clearer: https://x.com/olivtassinari/status/1849418686962061769

@oliviertassinari Ok, thanks for the clarification, I assumed something similar. 👌
It means that it appears working, but might stumble into certain problems along the way. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants