formatjs / formatjs-old

The monorepo home to all of the FormatJS related libraries.
https://formatjs.io/
156 stars 53 forks source link

`intl-unified-numberformat` stack overflow in IE11 #543

Closed jeffal closed 4 years ago

jeffal commented 4 years ago

Which package? intl-unified-numberformat

Describe the bug intl-unified-numberformat provided polyfill causes two bugs when loaded in IE11. SCRIPT28: Out of stack space SCRIPT 2343: Stack overflow at line: 396859

To Reproduce

  1. Include intl-unified-numberformat provided polyfill
  2. View web app in IE11
  3. See white screen of death and error in console

Expected behavior Expected the intl-unified-numberformat provided polyfill to not crash web app.

Screenshots

Screen Shot 2020-03-03 at 1 05 37 PM

Desktop (please complete the following information):

Additional context The provided ponyfill does not appear to cause the same error.

longlho commented 4 years ago

do you have a codesandbox?

jeffal commented 4 years ago

@longlho Here is a sandbox, Edit React-intl FormattedMessage using plural

However, I've tried https://codesandbox.io/, https://codepen.io/, https://jsfiddle.net/ and https://stackblitz.com/. They all either do not run due to unrelated errors or do not support IE11.

Is there something else I can do?

pyrocat101 commented 4 years ago

@jeffal can you deploy your repro (with unminified version of dist) to a static website hosting service? For example, now.sh, surge,sh, or even GitHub pages?

@longlho Happy to take this one since I have access to BrowserStack.

longlho commented 4 years ago

thanks @pyrocat101 all urs!

longlho commented 4 years ago

@jeffal what do you use to polyfill Intl.PluralRules?

jeffal commented 4 years ago

@longlho @formatjs/intl-pluralrules v1.5.2 (using v.1.5.3 in the sandbox)

require('@formatjs/intl-pluralrules/polyfill');
require('@formatjs/intl-pluralrules/dist/locale-data/en');

@pyrocat101 Here an updated codesandbox and deployment:

Edit intl-unified-numberformat

https://csb-lsjg9-m439j7rdt.now.sh/

Screen Shot 2020-03-28 at 11 58 52 PM
jeffal commented 4 years ago

@pyrocat101 Updated my previous comment with requested links. Thank you!