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

jsdom issue: 'slot):not([inert]' is not a valid selector #982

Closed
thumbsupep opened this issue Apr 25, 2023 · 7 comments · Fixed by #995
Closed

jsdom issue: 'slot):not([inert]' is not a valid selector #982

thumbsupep opened this issue Apr 25, 2023 · 7 comments · Fixed by #995

Comments

@thumbsupep
Copy link

thumbsupep commented Apr 25, 2023

If you regenerate package-lock and run tabbable's unit tests, you get the error SyntaxError: 'slot):not([inert]' is not a valid selector
I've narrowed this down to the update of one of jsdom's dependencies: [email protected] to [email protected]
This breaks unit tests for any consumers of tabbable who install latest and use jsdom.

I'm not sure if the fix is re-writing the [tabindex]:not(slot):not([inert]) selector, or if this is a bug that nwsapi needs to fix. Please advise.

@sbeugen
Copy link

sbeugen commented Apr 25, 2023

Can confirm. I have it in a Nuxt3 project, where we use focus-trap, which uses tabbable

@thumbsupep
Copy link
Author

looks like it relates to dperini/nwsapi#83

@stefcameron
Copy link
Member

@thumbsupep Thanks for bringing this to my attention. I replied on that issue. I'll see if I can add an override to tabbable's package.json to pin nswapi to v2.2.2 for now until they fix the issue.

stefcameron added a commit that referenced this issue May 3, 2023
Fixes #982

Tested locally by cloning this repo and then:
```
$ rm package-lock.json
$ npm install # regenerates package-lock.json
$ npm test # fails because of nwsapi issues post-v2.2.2
# edit package.json to add override clause
$ npm install # results in [email protected]
$ npm test # succeeds
```
@stefcameron
Copy link
Member

@all-contributors add @thumbsupep for test

@allcontributors
Copy link
Contributor

@stefcameron

I've put up a pull request to add @thumbsupep! 🎉

@stefcameron
Copy link
Member

@thumbsupep [email protected] should fix the problem for now!

@stefcameron
Copy link
Member

stefcameron commented Jun 27, 2023

@thumbsupep @sbeugen There is a proposal over on dperini/nwsapi#83 to modify the Regex that seemed to be the original problem here.

But today, while trying to verify the proposed Regex changes there, I followed these steps again and could not reproduce the original issue:

$ git clone tabbable
$ rm package-lock.json
# edit package.json to __remove__ the nwsapi override
$ npm install
# this results in nwsapi v2.2.5
$ npm test

Originally, npm test would fail with the error raised in this issue. But no more. All tests pass. They also all pass with the proposed Regex changes.

Could one of you please try your original steps but with the latest version of tabbable (and its dependencies) -- making sure to remove the override from package.json before npm install... -- and LMK if it's still an issue for you?

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

Successfully merging a pull request may close this issue.

3 participants