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

Date-io v2: Uncaught RangeError: Format string contains an unescaped latin alphabet character n #1440

Closed
moshest opened this issue Jan 5, 2020 · 40 comments

Comments

@moshest
Copy link

moshest commented Jan 5, 2020

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.

@nolandg
Copy link

nolandg commented Jan 6, 2020

For others struggling: if you installed @date-io@2.* you might see the error

Uncaught RangeError: Format string contains an unescaped latin alphabet character `n`

For now, downgrade to @date-io@^1.3.13.

@dmtrKovalenko dmtrKovalenko pinned this issue Jan 6, 2020
@dmtrKovalenko dmtrKovalenko changed the title Support @date-io V2 Uncaught RangeError: Format string contains an unescaped latin alphabet character n Jan 6, 2020
@dmtrKovalenko dmtrKovalenko changed the title Uncaught RangeError: Format string contains an unescaped latin alphabet character n Date-io v2: Uncaught RangeError: Format string contains an unescaped latin alphabet character n Jan 6, 2020
@dmtrKovalenko
Copy link
Member

Updated the docs. Also pinning this issue to make it easier to resolve the problem for v3 users

@mwskwong
Copy link

mwskwong commented Jan 7, 2020

BTW, @date-io has explicitly stated that in their release Github page

@niceropez
Copy link

niceropez commented Jan 7, 2020

Updated the docs. Also pinning this issue to make it easier to resolve the problem for v3 users

They do it!
Look here

@rvanmil
Copy link

rvanmil commented Jan 8, 2020

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).

@oliviertassinari
Copy link
Member

@dmtrKovalenko Since recently, we can leverage the optional peer dependencies, e.g. mui/material-ui#17211, that, I believe would warn if the version is not correct.

@oliviertassinari
Copy link
Member

@dmtrKovalenko Alternatively, what do you think of changing the npm tags (to have latest point to v1 and next point to v2), until we complete the upgrade of the picker components?

@dmtrKovalenko
Copy link
Member

Agree, but the main idea is that date-io is also used by other packages. We should not depend on date-io version.

Also there is a specific version of @date-ui/core that points picker to use ‘1.3.11’ and do the peer deps validation.

@rvanmil
Copy link

rvanmil commented Jan 9, 2020

Forgive my ignorance 😊 but wouldn't it be easier to be able to specify the utils library you want to use, instead of providing it through dependency injection? For example: <MuiPickersUtilsProvider utils='moment'>

@dmtrKovalenko
Copy link
Member

@rvanmil no, because it will lead to additional bundlesize and utils are directly importing moment or date-fns or any. So

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 9, 2020

Also there is a specific version of @date-ui/core that points picker to use and do the peer deps validation.

@dmtrKovalenko Nice, so we are good.


On a side note, I have noticed two potential opportunities:

@arturz
Copy link

arturz commented Jan 14, 2020

Very weird shit, I have to admit.

@mauriciocarnieletto
Copy link

👀

@Yuri-Tiofilo
Copy link

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.

@reoxb
Copy link

reoxb commented Mar 2, 2020

Dislike!

@haffedali
Copy link

I feel bad that I missed the note they left on their docs, it was even in bold LOL

@Temmermans
Copy link

How did you guys get it to work?
I tried downgrading like specified in this thread and followed the docs here but I still get the Format string contains an unescaped latin alphabet character n error.

@StefanJelner
Copy link

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.

@StefanJelner
Copy link

Sorry guys, but your stuff is not enterprise ready. I will have to look for alternatives.

@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 20, 2020

I don't understand what paths developers are following to end-up in this configuration. @StefanJelner What step did you took to reproduce this problem?

@dmtrKovalenko Maybe we should circle back to #1440 (comment). There is a high number of upvotes (70) in a small time frame (3 months). I understand that you consider @date-io/core a different package, but I think that we should face reality, the vast majority of the usage comes from this picker (I haven't seen anyone yet not using with this picker, but I haven't paid a lot of attention).

@dmtrKovalenko
Copy link
Member

@oliviertassinari we can easy make an additional release 3.2.11 to support date-fns v2. BUT this update is also must be major, so it will be 4.0.0
I really don't understand what is hard in just not update before v4 release of pickers?

@oliviertassinari
Copy link
Member

I really don't understand what is hard in just not update before v4 release of pickers?

Agree, let's try to gain more feedback from users. I don't understand how the issue could have had 70 upvotes.

@Olaide-EO
Copy link

RangeError: Format string contains an unescaped latin alphabet character n

I got the same error while trying to use @material-ui/pickers

@oliviertassinari
Copy link
Member

@Olaide-EO Do you have a reproduction?

@dmtrKovalenko
Copy link
Member

@Olaide-EO try install 1.x version of @date-io

@oliviertassinari
Copy link
Member

@nikosantis @lucasgabardo How did you end-up with this error?

@StephaneHo
Copy link

StephaneHo commented Mar 25, 2020 via email

@vasilii-b
Copy link

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

@mwskwong
Copy link

mwskwong commented Mar 30, 2020

RTFM Jesus...

The release page of date-io literally says Do not update if you are using @material-ui/pickers v3.
https://github.com/dmtrKovalenko/date-io/releases

@material-ui/pickers@^4 is currently in beta so either uses that or downgrade to date-io@^1.

Keep posting "same here", "+1" contributes NOTHING.

@mwskwong
Copy link

I really don't understand what is hard in just not update before v4 release of pickers?

Agree, let's try to gain more feedback from users. I don't understand how the issue could have had 70 upvotes.

I don't understand too. Nowadays people just don't read...

@mui mui deleted a comment from Surm4 Mar 30, 2020
@mui mui deleted a comment from JimmySoftLLC Mar 30, 2020
@mui mui deleted a comment from ondair Mar 30, 2020
@mui mui deleted a comment from mankittens Mar 30, 2020
@mui mui deleted a comment from nikosantis Mar 30, 2020
@mui mui deleted a comment from lucasgabardo Mar 30, 2020
@bmueller-sykes
Copy link

Perhaps this is obvious to everybody but me, but just so I'm clear...

There's a v4 of material-ui-pickers that's in the works? And that will resolve this issue? Is there a timeline for the release of v4?

@oliviertassinari
Copy link
Member

@bmueller-sykes v3 works, v4 works.

@bmueller-sykes
Copy link

wait...what? @date-io/2.x works with @material-ui/pickers 3.2.10? I'm confused. I thought that expressly doesn't work. Am I being dense?

@oliviertassinari
Copy link
Member

@bmueller-sykes Why do you want to use date-io v2 with pickers v3?

@bmueller-sykes
Copy link

@oliviertassinari Sorry, now I'm really confused. I use momentJS as my date library in my app overall. In my App.tsx file, I set up the pickers provider like this:

import { MuiPickersUtilsProvider } from '@material-ui/pickers';
import MomentUtils from '@date-io/moment';
<MuiPickersUtilsProvider utils={MomentUtils}>
rest of my app here
</MuiPickersUtilsProvider>

My relevant libs are:

"@date-io/moment": "1.3.13",
"@material-ui/pickers": "3.2.10",
"moment": "2.24.0",

So all I'm trying to do is keep all the libraries up to date.

I have a feeling that you're going to tell me I shouldn't be using @date-io/moment as the utils argument to MuiPickersUtilsProvider. My recollection is that I had to do things this way in order to integrate moment with the pickers. Maybe that's not true? I didn't intend for this to wind up as a support ticket, but here we are...

@oliviertassinari
Copy link
Member

So all I'm trying to do is keep all the libraries up to date.

@bmueller-sykes Interesting! The good news is that the owner of date-io is the main author on the pickers, you are already up to date.

@bmueller-sykes
Copy link

I can't tell if you're making fun of me or not.

@dmtrKovalenko
Copy link
Member

Closing issue, cause it was fixed in v4-alpha. If you are using v3, please lock version of date-io to 1.x
And wait for v4 stable :)

@mui mui locked and limited conversation to collaborators Apr 1, 2020
@oliviertassinari
Copy link
Member

@bmueller-sykes I wasn't making fun of anyone. I want to reassure the developers that try to upgrade: it's not needed, there is nothing to gain, let's be patient :).

@dmtrKovalenko dmtrKovalenko unpinned this issue Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests