Runtime issue: n.nodeName.toLowerCase is not a function
<< Please describe how you encountered this issue >>
axe-core version: 4.10.3
axe-extension version: 4.113.4
TypeError: n.nodeName.toLowerCase is not a function
at e (chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:301684)
at i (chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:301602)
at chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:302356
at Array.reduce (<anonymous>)
at e (chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:302327)
at i (chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:301602)
at chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:302356
at Array.reduce (<anonymous>)
at e (chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:302327)
at i (chrome-extension://lhdoppojpmngadmnindnejefpokejbdd/axe-versions/latest/axe.js:2:301602)
Thanks for the issue. I've actually never seen this error message before. Is the site where this happened public that I could look at? From the message my guess is that some JavaScript code is overriding native Node features as we would expect a node object to have a nodeName property.
The issue was caused by a field using nodeName as its name attribute. Changing this value resolved the problem.
Interesting. So the field looked like this and it threw the error? If so I think this would be something we might want to look out for in the future.
<form><input name="nodeName"/></form>
@straker I would like to work on this - can you please guide on the fix approach ?
i) I assume the fix would have to be generic, i.e extend to any name conflicts, and not just handle nodeName conflict ?
ii) Would the approach be to catch this sort of error, and instead report a message like Please use a different name for the <nodeName> attribute as this is reserved ?
If the above sounds good, will get started on the fix.
I'm not sure yet what approach we'll want to take to handle this. At the moment I believe these problems can only happen on form elements. We've already had to deal with this issue with the attributes property, but we don't want to do the same for this. We haven't looked into how we want to handle this yet since we will probably need to do something special for any form element we encounter, and will need to apply it throughout the code base.
For now I don't think this ticket is ready for outside contributors to take on.
@straker Got it, thanks for letting me know 👍