Using `[removed].hash.includes` throws “Object doesn't support property or method 'includes'” in IE11

后端 未结 8 729
生来不讨喜
生来不讨喜 2021-01-30 11:58

I am checking the URL to see if it contains or includes a ? in it to control the hash pop state in the window. All other browsers aren’t having an issue, only IE.

8条回答
  •  迷失自我
    2021-01-30 12:35

    I had a similar issue with an Angular project. In my polyfills.ts I had to add both:

        import "core-js/es7/array";
        import "core-js/es7/object";
    

    In addition to enabling all the other IE 11 defaults. (See comments in polyfills.ts if using angular)

    After adding these imports the error went away and my Object data populated as intended.

提交回复
热议问题