0

My project is a Ruby on Rails project and it ran fine before, but recently it stopped working in Chrome. It runs fine in Safari and Firefox.

When I have the developer tools window open and I refresh the page it pauses several times during load to yell at me

Paused on exception DOMException: Failed to execute 'querySelectorAll' on 'Element': '\' is not a valid selector.

then as I play through the breaks...

DOMException: Failed to execute 'querySelectorAll' on 'Element': '*,:x' is not a valid selector.

DOMException: Failed to execute 'matches' on 'Element': '[s!='']:x' is not a valid selector.

The line of code is

el.querySelectorAll("\\\f"); el.querySelectorAll("*,:x"); matches.call(el, "[s!='']:x");

This issue happens in both sizzle.js and jquery.js respectively.

The Call stack is just dependencies and nothing I wrote.

(https://i.stack.imgur.com/TamRZ.png)

This problem started happening around a month or so ago when I updated Chrome, so I checked out a branch and reverted to a commit from multiple months ago. I then clobbered webpack and recompiled all my dependencies because I was positive I did not have this issue before. Alas, it does not work either.

Is there some bug in the most recent version of Chrome for MacOS?

freedomn-m
  • 27,664
  • 8
  • 35
  • 57
ontsin
  • 1
  • 3
  • The error messages seem pretty clear, you're using invalid selectors when you call `querySelectorAll()`. Please post a [mre] that shows how you're generating the selectors. – Barmar Aug 10 '23 at 00:01
  • @Barmar By using jquery in my project. I specified that this happens in both sizzle.js and jquery.js. Sizzle was introduced as part of jQuery in version 1.3 – ontsin Aug 10 '23 at 00:03
  • You're still giving incorrect selectors. The first error says that you tried to use a backslash as a selector, that's not valid. – Barmar Aug 10 '23 at 00:05
  • If there were such a serious bug in Chrome, you wouldn't be able to access many websites. – Barmar Aug 10 '23 at 00:06
  • My bad, I had clicked some bad stuff in the Sources dev tool – ontsin Aug 10 '23 at 00:15

1 Answers1

0

https://github.com/jquery/sizzle/blob/main/src/sizzle.js#L879

This line of code in the jquery source code throws an exception.

Make sure the Sources dev tool for Chrome is not configured to Pause on uncaught exceptions and Pause on caught exceptions

ontsin
  • 1
  • 3