material-ui-pickers: Date-io v2: Uncaught RangeError: Format string contains an unescaped latin alphabet character `n`
The @date-io library release a new version v2 that’s break this module.
Please update docs and require install only version 1.X from @date-io in the meantime.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 92
- Comments: 40 (18 by maintainers)
For others struggling: if you installed
@date-io@2.*you might see the errorFor now, downgrade to
@date-io@^1.3.13.Very weird shit, I have to admit.
Would it perhaps be possible to have the proper versions of the @date-io libaries listed as dependencies in this project instead of referring to a note in an installation guide? Tbh I think it’s a bit odd we have to manually manage the @date-io dependencies because @material-ui/pickers doesn’t specify the versions it requires (and so we now have two outdated dependencies in our projects which need to be pinned to the 1.x release for the time being).
Had the same problem, but I had access to this site https://material-ui-pickers.dev/getting-started/installation, which helped me install Date-io V1, enabling the use of datePicker.
give this man a cookie
BTW,
@date-iohas explicitly stated that in their release Github pageDislike!
v2 of DateIO will not be supported for v3 of pickers.
Is there any plan to fix this? It was reported on 5th of January and i am still getting this error. That’s more than 2 months for something that prevents me from keeping my libraries up to date.
@dmtrKovalenko Nice, so we are good.
Yarn/npm will warn about the peer dependency issue. https://github.com/mui-org/material-ui-pickers/blob/a865eaae2ddfc72864e410234d2adc5567c69d98/lib/package.json#L34-L35 It’s a shame developers have learned to ignore these warnings (myself included). I guess this is a good reminder that the install warnings aren’t meant to be ignored.
The problem is transient until we deploy a new version of the pickers that rely on the latest version of date-io.
Updating the install commands in the documentation could help in the meantime.
On a side note, I have noticed two potential opportunities:
prop-typesas a dependency (not a peer) https://github.com/mui-org/material-ui-pickers/blob/689d7d33bdac5e649d4e5c6ca37f9f523c80b8cf/lib/package.json#L37libfolder, a folder that GitHub doesn’t index, which makes searching the source with the UI impossible (I was querying for “@date-io”). I have learned about this aspect when working on Next.js, they have some of the sources in a lib folder, it was driving me crazy 😆.@dmtrKovalenko Since recently, we can leverage the optional peer dependencies, e.g. https://github.com/mui-org/material-ui/pull/17211, that, I believe would warn if the version is not correct.
They do it! Look here