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

[pickers] package is incompatible with @mui/material for versions equal to or lower than 5.8.x #8530

Closed
2 tasks done
Nic-S opened this issue Apr 6, 2023 · 11 comments · Fixed by #8531
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes

Comments

@Nic-S
Copy link

Nic-S commented Apr 6, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/exciting-snyder-56xih1

Current behavior 😯

build error

Expected behavior 🤔

fix ir or upgrade peer dependency of pikers and documentation

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID or Support key 💳 (optional)

No response

@Nic-S Nic-S added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 6, 2023
@LukasTy
Copy link
Member

LukasTy commented Apr 6, 2023

Thank you very much for opening this issue and reporting stale peerDeps! 🙏

@LukasTy LukasTy added bug 🐛 Something doesn't work core Infrastructure work going on behind the scenes component: pickers 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 Apr 6, 2023
@Nic-S
Copy link
Author

Nic-S commented Apr 7, 2023

@LukasTy Another point to watch out for is the @mui/base dependency, as it is not among the peer dependencies and if an older version of npm such as 8.1 is used for package installation, it causes problems as the dependencies of downloaded packages are not installed in the root of the project's node_modules.

@LukasTy
Copy link
Member

LukasTy commented Apr 7, 2023

@Nic-S Thank you for the heads-up. We'll look into it. 👌

@LukasTy
Copy link
Member

LukasTy commented Apr 10, 2023

if an older version of npm such as 8.1 is used for package installation, it causes problems as the dependencies of downloaded packages are not installed in the root of the project's node_modules.

I've tried experimenting with your provided problematic scenario.
I've downgraded npm to 8.1.0, created an empty project, added the necessary dependencies, installed everything and successfully ran an app having a DatePicker. The @mui/base has been installed on the root node_modules level. 🤔
Maybe there is something I'm missing? A different npm version? 🤔

@Nic-S
Copy link
Author

Nic-S commented Apr 11, 2023

if an older version of npm such as 8.1 is used for package installation, it causes problems as the dependencies of downloaded packages are not installed in the root of the project's node_modules.

I've tried experimenting with your provided problematic scenario. I've downgraded npm to 8.1.0, created an empty project, added the necessary dependencies, installed everything and successfully ran an app having a DatePicker. The @mui/base has been installed on the root node_modules level. 🤔 Maybe there is something I'm missing? A different npm version? 🤔

Very strange 🤔. I use node version 16.13.0 with its version of npm i.e. 8.1.0, and as you can see from the screen i don't have @mui/base in the root of mui's node_modules and this causes me errors in the build.

(I have the minors installed right)
Screenshot 2023-04-11 alle 11 25 38
Screenshot 2023-04-11 alle 11 25 46
Screenshot 2023-04-11 alle 11 28 41

@LukasTy
Copy link
Member

LukasTy commented Apr 11, 2023

I have only downgraded npm. Will try looking if downgrading node has an effect (even though it would be super strange).
By the way: What kind of bundler are you using?
Having a minimal repo where it would be possible to reproduce the issue would go a long way. 🙈

@LukasTy
Copy link
Member

LukasTy commented Apr 11, 2023

I've tried using all your mentioned packages with exact versions as well as downgraded to node 16.13.0 and both the installation as well as build passed without issues. 🙈

Screenshot 2023-04-11 at 16 42 54

Have you tried the usual first solution when you have problems? Nuke node_modules and reinstall? 🤔

@Nic-S
Copy link
Author

Nic-S commented Apr 11, 2023

Honestly I am surprised, I also did a test from scratch and I have packages like yours that are different from my project.

Screenshot 2023-04-11 alle 18 24 27

I investigate better but at this point it is a problem with my project, I have of course already tried to re-install from scratch including the clean npm cash.

Right now I feel a little bit like this:
MicrosoftTeams-image (1)

@Nic-S
Copy link
Author

Nic-S commented Apr 11, 2023

@LukasTy OK, with node 16.13.0 and npm 8.1.0 and react 17, we have the package problem. (why we don't have the problem with react 18 I still don't understand)

Screenshot 2023-04-11 alle 20 31 42

if we upgrade to node 16.14.0 and use its npm 8.3.1 also with react 17 we no longer have the problem.

Screenshot 2023-04-11 alle 20 41 46

@LukasTy
Copy link
Member

LukasTy commented Apr 12, 2023

@Nic-S I can confirm that your use case is reproducible.
Seeing this case, IMHO, it makes sense to add @mui/base as a peerDependency and avoid such a case. 👌
P.S. I've tested locally that adding @mui/base as peer dep to @mui/x-date-pickers solves this issue. 😉

@Nic-S
Copy link
Author

Nic-S commented Apr 12, 2023

@Nic-S I can confirm that your use case is reproducible. Seeing this case, IMHO, it makes sense to add @mui/base as a peerDependency and avoid such a case. 👌 P.S. I've tested locally that adding @mui/base as peer dep to @mui/x-date-pickers solves this issue. 😉

Yes because peer dependencies are downloaded differently than dependencies. Thank you for your availability!

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: pickers 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

Successfully merging a pull request may close this issue.

2 participants