在 asp.NET WVC 应用程序中,打开的每个页面都会在 Edge DevTools 中引发相同的错误...
"stack": "Error: Failed to execute 'querySelector' on 'Document': ':has(*,:jqfake)' is not a valid selector.\n
...查找错误会建议一个具有整数的 ID。问题是,我如何追踪以找到有问题的项目?看起来很奇怪,它在每个页面上,所以必须与全局加载的东西相关。
这是 jQuery 3.7.1 和 Bootstrap 5
这是 jQuery 的一部分,正在测试以确保正确解析
:has()
选择器:
// 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;
}
既然您看到了错误,这意味着您的浏览器通过了此测试。
但是,由于异常已被捕获,您可能不应该在开发工具中看到它。您是否可能会暂停caught异常,而不仅仅是uncaught异常?