Open junaidfarooqui opened 5 years ago
There are no usages of the string this.each
in this codebase, so your problem is probably somewhere else.
Hi @patrick-mcdougle, Yeah the error actually showing in a prototype.js file. but as I mentioned I need to use this lib in magento, so somehow it's conflicting with prototype. may be you can try to add this cdn file into project and see the error.
https://cdnjs.cloudflare.com/ajax/libs/prototype/1.7.3/prototype.js
Hi @junaidfarooqui
Try adding this to a custom js file:
if ('NodeList' in window) {
if (!NodeList.prototype.each && NodeList.prototype.forEach) {
NodeList.prototype.each = NodeList.prototype.forEach;
}
}
It's a workaround since prototype.js changes the default behavior. I had the same issue and was able to fix with this.
This is:
Specifications
Steps to Reproduce the Problem
Detailed Description
I tried to use this in my magento project but it is have problem with prototypeJs, as you already knows magento is using prototype JS for all JS stuff. i did solve jQuery conflict problem but this shouldn't cause any problem as i can see it's simple javascript. i will appriciate if anybody can solve this issue or guide me into right direction.