mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

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

Open berenicestr opened this issue 2 years ago • 2 comments

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 avatar Feb 08 '24 11:02 berenicestr

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 avatar Feb 08 '24 11:02 flaviendelangle

Excellent! Thank you!

berenicestr avatar Feb 08 '24 11:02 berenicestr