Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute querySelectorAll #599

Closed
patrickhulce opened this issue Nov 3, 2017 · 4 comments
Closed

Failed to execute querySelectorAll #599

patrickhulce opened this issue Nov 3, 2017 · 4 comments
Labels
core Issues in the core code (lib/core) fix Bug fixes

Comments

@patrickhulce
Copy link

patrickhulce commented Nov 3, 2017

Hey folks first sayin' a big thank you for your great work :)

We discovered this over in Lighthouse on https://www.walgreens.com/store/c/contact-lenses/ID=359432-tier2clense?vredirID=1

Trying in the extension does nothing after clicking "Analyze" and throwing axe into the page running manually yields the error below which is the same as what you get with Lighthouse. Seems like you might need to escape the colon in the custom tag name?

Anecdotally, I also saw this happen to another Lighthouse user at Chrome Dev Summit so it isn't isolated to just this page.

DOMException: Failed to execute 'querySelectorAll' on 'Document': 'wag:view-product-details' is not a valid selector.
    at HTMLDocument.querySelectorAll (https://www.walgreens.com/i10c@p1/client/nv-8.0.6/auto/instart.js?i10c.opts=monitor.html_streaming:73:185)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2058:47)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
    at createUniqueSelector (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
    at Object.createUniqueSelector [as getSelector] (https://cdnjs.cloudflare.com/ajax/libs/axe-core/2.4.2/axe.js:2066:14)
@dylanb
Copy link
Contributor

dylanb commented Nov 3, 2017

Looks like whenever we generate a selector that has a special character like :, we should escape it \\:. This code worked in the console:

document.querySelectorAll('wag\\:view-product-details')

@dylanb dylanb added the fix Bug fixes label Nov 3, 2017
@marcysutton
Copy link
Contributor

I think this should already be covered by #566, possibly. It's choking on the invalid tag name.

@patrickhulce
Copy link
Author

Ah yeah looks like a dupe of #563!

@marcysutton
Copy link
Contributor

Ok, I'll close this as a duplicate. Thanks for your report!

@WilcoFiers WilcoFiers added the core Issues in the core code (lib/core) label Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) fix Bug fixes
Projects
None yet
Development

No branches or pull requests

4 participants