We are using Aurelia JS in our project.
On IE11 we get error conntected to missing “includes” method: Object doesn’t support property or method ‘includes’
We’ve installed aurelia-polyfills plugin but it doens’t work (or we use it in wrong way).
If Im guessing right, its probably the api array.includes? If so, i dont recall it being the official polyfill for an Aurelia app. The polyfills module is intended to be the bare minimum required for Aurelia to work only. Maybe you could look for an extra polyfill, or use something like polyfill.io?
Ok, dear collegues, I can use indexOf or other solution but why aurelia-pollyfils plugin is still in official repository, if it doesn’t work?! BUT, code inside includes function is the same like on MDN. And it works when you are using it in “normal” way (classic JS, no Aurelia).
So maybe only we just included this plugin wrongly?
I’ve also tried to invoke custom js functon with polyfill from MDN inside, but without possitive result. Code is execuded, but in Aurelia I get the same error on IE11 ( Object doesn’t support property or method ‘includes’)
The aurelia-polyfills “plugin” is intended to guarantee a minimal set of standardized APIs that is needed to avoid having to have different code paths to do the same thing, or reinvent some wheels.
And it works when you are using it in “normal” way (classic JS, no Aurelia).
So maybe only we just included this plugin wrongly?
I’m guessing:
you didn’t include the polyfills correctly. Maybe try add to the top of your index.html:
Damn…
Info in console was not inaccurate.
In my case “includes” was executed not on Array, but String object (facepalm).
And inside “aurelia-polyfills” there is no such polyfill (only for Array).
So I’ve reused snippet from MDN and imported it via webpack.
Thanks for help