Closed bbuhler closed 3 years ago
Same here when trying to use with wkhtmltopdf... :(
I have overcome the issue by wrapping all query selectors with Array.prototype.slice.call. Example: Array.apply(null,Array.prototype.slice.call(o.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])')))
Based on query selector in @bbuhler's error message and @tiperes' proposed fix, it looks like you both might be experiencing the same issue but at different points in the code:
@bbuhler:
@tiperes:
This feels like a similar to #144, which is to say the code above works fine but perhaps there is some app- or framework-specific condition that can cause the rootElement
or the node list returned from the querySelectorAll()
method to become invalid while the pony fill is doing its work. Hard to say without doing a deeper div into each app.
I have created a branch with a possible fix: https://github.com/jhildenbiddle/css-vars-ponyfill/tree/fix-153. I just switched all nodelist-to-array conversions from Array.apply
to [].slice.call
. Not sure if that will address the issue, but it's an easy fix and worth a shot. Checkout that branch, build, then test your preferred version in /dist
. If this fixes your issue I'll publish a patch release. If you see other errors in Sentry, let me know and we'll continue trying to resolve the issues.
@bbuhler @tiperes Ping!
Hi @jhildenbiddle, I didn't had the chance to reproduce and test your branch yet. I tried using Firefox 24 via Browserstack, but unfortunately the VM browser always became unresponsive and ultimately crashed.
I will give it another try next week.
Hi @jhildenbiddle, I was not able to reproduce the issue in a real browser. But as @tiperes mentioned it is reproducible with wkhtmltopdf CLI tool, so I tried with that and it looks like your changes resolves the issue.
Thank you (:
Hello (:
First of all thank you for your great work!
In our Sentry we see an exception connected to your library so I am posting it here:
It appears mainly on Firefox (24) and (Mobile) Safari.
Cheers, Ben