Trying this on an existing project works fine if I run start() after the DOM is fully done rendering, but throws an exception during certain childList mutations. The pseudoLocation function is called with wrong options (it get's called with 0 in my case) in this line:
https://github.com/tryggvigy/pseudo-localization/blob/master/index.js#L46
I haven't quite figured out what exactly is triggering the issue yet, but I was able to fix it by inverting the options and partially applying it with the correct options to forwarding to the addedNode.forEach to avoid excess parameters messing up the options argument.
I will create a PR with the safeguards which work for my project (I also seem to need #6 ), and try to figure out why it fails in the first place.
Thanks for this project Tryggvi!
Trying this on an existing project works fine if I run
start()
after the DOM is fully done rendering, but throws an exception during certain childList mutations. ThepseudoLocation
function is called with wrongoptions
(it get's called with0
in my case) in this line: https://github.com/tryggvigy/pseudo-localization/blob/master/index.js#L46I haven't quite figured out what exactly is triggering the issue yet, but I was able to fix it by inverting the
options
and partially applying it with the correct options to forwarding to the addedNode.forEach to avoid excess parameters messing up the options argument.I will create a PR with the safeguards which work for my project (I also seem to need #6 ), and try to figure out why it fails in the first place.