Intl.js icon indicating copy to clipboard operation
Intl.js copied to clipboard

toLocaleString polyfill causes regex error

Open pbcomm opened this issue 7 years ago • 4 comments
trafficstars

Error: Invalid regular expression: /[\s\S]{2}(((((((())))))))[\s\S]{1})/: Unmatched ')'

This happens on all browsers that require the polyfill. Using version 1.2.5

pbcomm avatar Apr 05 '18 16:04 pbcomm

Happens to me too.

pedrofracassi avatar Nov 27 '18 04:11 pedrofracassi

Same here

hielkehoeve avatar Dec 18 '18 15:12 hielkehoeve

Did you try to call Intl.__disableRegExpRestore() as mentioned here and here?

ghostd avatar Dec 18 '18 19:12 ghostd

This also happened to us on Android in our React Native app. We used this code to fix it on Android, but do nothing on iOS:

if (global.Intl.__disableRegExpRestore) {
  global.Intl.__disableRegExpRestore()
}

danieldiekmeier avatar Mar 11 '20 16:03 danieldiekmeier