“Intl not available” in Edge 15

二次信任 提交于 2019-12-05 01:48:50

Make sure your JS code doesn't redefine standard Map class.

We had almost the same problem, but with Intl.Collator object instead. We couldn't use String.prototype.localeCompare("...", "locale") because of this.

You can look at this codepen in Edge 15 and in other browsers for explanation: https://codepen.io/kgorob/pen/pweaWV.

P.S. I'm not sure your problem is because of Map class specifically, maybe it's some other standard JS class you are re-defining.

The problem is because of these lines in Chakracore code. Intl.js is javascript file that is used internally to perform various internationalization specific operations. Since Mapis used, over-writing it before Intl.js code executes (it is executed lazily), causes problem. This should be addressed soon.

As ksp's answer says, this is caused by Intl lazy-loading after Map is overwritten. Therefore, the easiest workaround is to just force it to initialise early, before other scripts run:

<html>
  <head>
  <script>Intl.DateTimeFormat</script>
  ...

Here is the issue in the Chakra repo: https://github.com/Microsoft/ChakraCore/issues/3189

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!