Skip to content

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

@thetutlage

Description

@thetutlage

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions