Intl.js
Intl.js copied to clipboard
Intl.js with polyfill not working on Safari
We were using this library successfully but for some reason it stopped working last Friday.
When loading the html that includes the Intl polyfill reference (https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en) the following errors are displayed in Safari:
The result is a blank page instead of the expected content loaded.
Not sure if this is an Intl.js error, or a polyfill one, but any help would be greatly appreciated!
@mtlewis could this be related to #244?
@caridy Yes, I would expect this to be fixed by #244 :D
Ok, I will try to do the release tomorrow morning.
@caridy Any chance of doing a release?
@caridy friendly reminder
Any news on this release @caridy?
As a workaround you can use v1.2.4 for now. But definitely project needs more collaborators!
@chicoxyzzy unfortunately that is not an option when using it with polyfill.io... 😞
@Turbo87 Remove it from polyfill.io and polyfill it yourself for a while until it is fixed. A bloated bundle is better than a broken site.
@ruiaraujo to be honest I'd rather work on fixing the cause of the problem, but that unfortunately seems harder than I hoped...
@reiniergs is helping with the tests at the moment, trying to get the test suite back to life, and validate that we are good. We don't want to push a broken build again (like the RegExp issue from last time). I'm currently out until the second week of January. Apologies for the inconvenience, and I will be very supportive of more hands on the deck, if someone has time to help.
@caridy thanks for the feedback! can you elaborate on what is wrong with the test suite? any way we can help?
@Turbo87 the saucelab config is a mess at the moment. On top of that, errors happening during the testing process are completely obscure (at the moment there are ~18 failures on IE, but the error tells nothing about the actual error).
Um.. just a little note that while waiting for the fix, we can also disable "RegExp cache / restore" as explained in the documentation if you want to use latest version (or if you must, thank to polyfill.io)
I'm not sure about everyone's cases, but it works for mine and I also think the document is right that it "is not strictly necessary" and you can disable it.
Same happening on on 1.2.5 IE10, 1.2.4 works fine
@caridy please let me know if there's anything (#244 related or otherwise) that I can do to help get the next version ready for release. :+1:
I just ran into this problem with the npm package for NodeJS (thus not Polyfill.io)...
SyntaxError: Invalid regular expression: /[\s\S]{2}(((((((())))))))[\s\S]{1})[\s\S]{3}/: Unmatched ')'
at new RegExp (<anonymous>)
at C:\Source\TweeDuizenden\node_modules\intl\lib\core.js:590:20
at InitializeNumberFormat (C:\Source\TweeDuizenden\node_modules\intl\lib\core.js:2077:5)
at new NumberFormatConstructor (C:\Source\TweeDuizenden\node_modules\intl\lib\core.js:1838:12)
at CreateDateTimeParts (C:\Source\TweeDuizenden\node_modules\intl\lib\core.js:3898:14)
at FormatDateTime (C:\Source\TweeDuizenden\node_modules\intl\lib\core.js:4079:17)
at DateTimeFormatConstructor.F (C:\Source\TweeDuizenden\node_modules\intl\lib\core.js:3848:20)
at Object.getLocaleDateString (C:\Source\TweeDuizenden\app\helpers.js:65:107)
at C:\Source\TweeDuizenden\controllers\game.js:322:42
at model.Query.<anonymous> (C:\Source\TweeDuizenden\node_modules\mongoose\lib\model.js:3731:16)
at C:\Source\TweeDuizenden\node_modules\kareem\index.js:277:21
at C:\Source\TweeDuizenden\node_modules\kareem\index.js:131:16
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
One proposed solution above about disabling RegExp cache doesn't work.
Intl 1.2.5
NodeJS v7.7.4
npm 4.1.2
Edit: see https://github.com/andyearnshaw/Intl.js/issues/231
Intl 1.2.5
NodeJS 6.10.3
Npm 5.0.4
When polyfills is applaied i get this error message:
Invalid regular expression: /[\s\S]{4}(((((((())))))))[\s\S]{3})/: Unmatched ')'
No news about it?
Based on PR and issue discussions it looks like #244 fixed this, but there hasn't been a release since 11/16/16 when it was merged.
Wow it has been so long since this issue appear.. Now we even already dropped support for Safari < 10, which is the reason we need to use this library in the first place 😂
Meanwhile downgrade to 1.2.4..it's works fine!
This is still an issue. We hard coded 1.2.4 and removed the carot from our package.json for now.
Thanks to @dvkndn, disabling regex caching seems to fix the problem for me as well:
Intl.__disableRegExpRestore()
Also having SyntaxError: Invalid regular expression: /[\s\S]{4}(((((((())))))))[\s\S]{3})/: Unmatched ')'.
Started having it randomly.
Intl.__disableRegExpRestore() works.
But the workaround won't work in this case:
// Determine if the built-in `Intl` has the locale data we need
if (!are_intl_locales_supported(locales))
{
// `Intl` exists, but it doesn't have the data we need, so load the
// polyfill and patch the constructors we need with the polyfill's
Intl.NumberFormat = Intl_polyfill.NumberFormat
Intl.DateTimeFormat = Intl_polyfill.DateTimeFormat
}
Hard-coding version 1.2.4 in package.json then.
Intl is present in all modern browsers except Internet Explorer 10, Safari 9 and iOS Safari 9.x.
Node.js server-side rendering will still need it because Node only comes prepackaged with English language.
Intlis present in all modern browsers except Internet Explorer 10, Safari 9 and iOS Safari 9.x.
It's not available outside the browser, which is still something lots of people face (Node, react-*). I had the same problem today. It's actually very annoying to get a previous version when there are requirements for >1.2.5, so would be great to get a 1.2.6 release to fix this!