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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid selector errors are not catched #1035

Open
bcalou opened this issue May 29, 2024 · 1 comment
Open

Invalid selector errors are not catched #1035

bcalou opened this issue May 29, 2024 · 1 comment

Comments

@bcalou
Copy link

bcalou commented May 29, 2024

Hi and thanks for your work!

馃悰 Bug Report

When using a "modern" CSS selector such as :has, older browser will fail to use document.querySelector, which is expected :

Uncaught DOMException: Document.querySelector: '.my-form__field:has(input#name)' is not a valid selector

However, the error is not catched and the whole app crashes (white page).

To Reproduce

Use the reproduction link below or :
Try to select an element with a selector that your browser does not support.
You can make up a selector that doesn't exist so it will fail regardless of the browser.

Expected behavior

I believe the error should be catched and the step (or tour) skipped.
I think it may be a common mistake to think that the selector will fail silently (as they do when using CSS, but not when using querySelector).

Link to repl or repo (highly encouraged)

Try this tour : the second step should crash your page.

codesandbox

Thanks :)

@gilbarbara
Copy link
Owner

Hey @bcalou
Thanks for your report. I've already fixed it in the #1036 PR. I'm waiting for a response to another issue, and I'll release it next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants