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

[AdapterDateFns] Error installation latest version of date-fs package #11991

Closed
berenicestr opened this issue Feb 8, 2024 · 2 comments
Closed
Labels
component: pickers This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement

Comments

@berenicestr
Copy link

berenicestr commented Feb 8, 2024

Steps to reproduce

I use date-fs package in all my project.

When I update/install package from v.2.30.0 to latest v.3.3.1 get an error.

Link to live example: (required) : https://codesandbox.io/p/sandbox/unruffled-cdn-nk68d2
If you remove from the package "date-fs": "latest”, the project runs. If you include it, the project not run.

Steps:
Install the latest version of date-fs (v.3.3.1):

npm install date-fs@latest it gives me this error:

✘ [ERROR] Missing "./_lib/format/longFormatters" specifier in "date-fns" package [plugin vite:dep-pre-bundle]

    node_modules/@mui/x-date-pickers/AdapterDateFns/AdapterDateFns.js:58:27:
      58 │ import longFormatters from 'date-fns/_lib/format/longFormatters';

Thanks in advance.

Current behavior

Not install the latest version of date-fs.

Expected behavior

Install / update the latest version date-fs package.

Context

Update the latest version of my libraries.

Your environment

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

Search keywords: date-fs

@berenicestr berenicestr added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 8, 2024
@berenicestr berenicestr changed the title [AdapterDateFns] Error installation latest version date-fs package [AdapterDateFns] Error installation latest version of date-fs package Feb 8, 2024
@flaviendelangle
Copy link
Member

Hi,

You should use :AdapterDateFnsV3 which is available on the latest v6 releases (and v7 beta)

See https://mui.com/x/react-date-pickers/adapters-locale/#with-date-fns for more information

@flaviendelangle flaviendelangle added support: question Community support but can be turned into an improvement 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 Feb 8, 2024
@berenicestr
Copy link
Author

Excellent! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

2 participants