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

DOMException: Failed to execute 'matches' on 'Element': ':none' is not a valid selector. #497

Closed
thetutlage opened this issue May 24, 2023 · 3 comments

Comments

@thetutlage
Copy link

thetutlage commented May 24, 2023

Bug description

I faced this issue with the latest version of Unpoly (3.1) but couldn't pin it down or reproduce it. So I downgraded to 2.x.

I was recently on the Unpoly documentation website and noticed some links stopped working with the following console error.

Uncaught (in promise) DOMException: Failed to execute 'matches' on 'Element': ':none' is not a valid selector.
    at up.Selector.matches (https://unpoly.com/javascripts/guide-fbbe73a7.js:26:11030)
    at up.Selector.closest (https://unpoly.com/javascripts/guide-fbbe73a7.js:26:11109)
    at Object.v [as closest] (https://unpoly.com/javascripts/guide-fbbe73a7.js:26:26717)
    at up.FragmentFinder.findClosest (https://unpoly.com/javascripts/guide-fbbe73a7.js:24:29060)
    at up.FragmentFinder.findAroundOrigin (https://unpoly.com/javascripts/guide-fbbe73a7.js:24:28990)
    at up.FragmentFinder.find (https://unpoly.com/javascripts/guide-fbbe73a7.js:24:28842)
    at f (https://unpoly.com/javascripts/guide-fbbe73a7.js:26:26374)
    at Object.x [as reload] (https://unpoly.com/javascripts/guide-fbbe73a7.js:26:27148)
    at e.revalidate (https://unpoly.com/javascripts/guide-fbbe73a7.js:24:11836)
    at e.finish (https://unpoly.com/javascripts/guide-fbbe73a7.js:24:11570)

I created a screen recording of the same for reference.

I suspect it has something to do with the cache layer of Unpoly, which is significantly different in 3.x. In the screen recording, I also inspect the cache map of a broken and a working link, which has some differences.

Reproduction project

Untitled.mp4

Steps to reproduce the behavior:

Unfortunately it is difficult to reproduce. The error happens randomly.

Expected behavior

The links should work :)

Browser version

  • OS: macOS Version 13.0 (Build 22A380)
  • Browser Chrome
  • Version 113
@adam12
Copy link
Member

adam12 commented May 24, 2023

Interesting. I thought this was fixed a few weeks ago on the demo site. We might need to investigate again.

@thetutlage
Copy link
Author

Not sure if this information will help. Following is the debug log for the broken link.

Screen Shot 2023-05-24 at 21 37 48

Thinking out load. Maybe 304 response rewrites the unpoly cache with an empty body?

@triskweline
Copy link
Contributor

Maybe 304 response rewrites the unpoly cache with an empty body?

That might be it.

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

No branches or pull requests

3 participants