In an asp.NET WVC app every single page that is opened throws the same error in Edge DevTools...
"stack": "Error: Failed to execute 'querySelector' on 'Document': ':has(*,:jqfake)' is not a valid selector.\n
...looking up the error would suggest an ID that has an integer. Question is, how do I track that back to find the offending item? Seems strange that it's on every page so must relate to something that is globally loaded.
This is jQuery 3.7.1 and Bootstrap 5
That's part of jQuery, which is testing to ensure that the :has()
selector is parsed correctly:
// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
// Make sure the `:has()` argument is parsed unforgivingly.
// We include `*` in the test to detect buggy implementations that are
// _selectively_ forgiving (specifically when the list includes at least
// one valid selector).
// Note that we treat complete lack of support for `:has()` as if it were
// spec-compliant support, which is fine because use of `:has()` in such
// environments will fail in the qSA path and fall back to jQuery traversal
// anyway.
try {
document.querySelector( ":has(*,:jqfake)" );
support.cssHas = false;
} catch ( e ) {
support.cssHas = true;
}
Since you're seeing the error, that means your browser passes this test.
However, since the exception has been caught, you probably shouldn't see it in the dev tools. Are you perhaps pausing on caught exceptions rather than just uncaught ones?