Closed nate-summercook closed 2 years ago
@oliviertassinari @nate-summercook maybe it's caused by the -alpha.0
dependency (instead of -alpha.2
) here: https://github.com/mui/material-ui/blob/master/packages/mui-lab/package.json#L75
If you are on react v18 the current versions are unresolvable (as -alpha.0
had only react v17 peer dependency)
@oliviertassinari @nate-summercook maybe it's caused by the
-alpha.0
dependency (instead of-alpha.2
) here: https://github.com/mui/material-ui/blob/master/packages/mui-lab/package.json#L75
No, I did try with -alpha.2
(through resolutions. Didn't fix the problem.
@nate-summercook Please provide a minimal reproduction. @mui/x-date-pickers
is not supposed to be used though @mui/lab
for new projects. In step 4, you also need to install @emotion/react
and @emotion/styled
in your project.
Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.
@nate-summercook Please provide a minimal reproduction.
@mui/x-date-pickers
is not supposed to be used though@mui/lab
for new projects. In step 4, you also need to install@emotion/react
and@emotion/styled
in your project.
I'm not using @mui/x-date-pickers
through @mui/lab
, but the fact that it's contained within @mui/lab
lets yarn pnp fail already because the peerDependencies are not declared.
Duplicates
Latest version
Current behavior 😯
Yarn PnP (Plug'n'Play) is more strict when it comes to specifying a library's peerDependencies correctly. Currently, @mui/lab is missing the following entries in peerDependencies as they are peerDependencies of
@mui/x-date-pickers
:@emotion/react
@emotion/styled
This causes errors like this one:
Expected behavior 🤔
If the mentioned packages were added to peerDependencies, these errors would not occur with yarn pnp.
It would maybe also make sense to add them as optional peer dependencies because mui can also be used with styled-components instead of emotion.
Steps to reproduce 🕹
This bug is connected to https://github.com/mui/mui-x/issues/4761. I created a PR to fix the issue on
@mui/x-date-pickers
but after that, this library depending on@mui/x-date-pickers
will have the same problem as it also doesn't declare these peer deps. So reproduction for this issue would be the same (also aftermui-x
is fixed):npx create-react-app mui-x-date-pickers
yarn set version berry
in order to get the latest yarn version with pnpyarn add @mui/lab @mui/material @mui/system
function App() { const handleDateChange = () => { };
return ( <CalendarPicker date={null} onChange={handleDateChange} /> ); }
export default App;
System: OS: macOS 12.3.1 Binaries: Node: 16.11.1 - /opt/javascript/ncanode/16.11.1/node/bin/node Yarn: 3.2.0 - /opt/javascript/ncayarn/1.22.4/bin/yarn npm: 8.0.0 - /opt/javascript/ncanode/16.11.1/node/bin/npm Browsers: Chrome: 101.0.4951.54 Edge: Not Found Firefox: 99.0.1 Safari: 15.4 Browser used: Brave [Version 1.37.116 Chromium: 100.0.4896.127 (Official Build)]