Sentry-javascript: [safari] SyntaxError: The string did not match the expected pattern.

Created on 11 Mar 2020  路  19Comments  路  Source: getsentry/sentry-javascript

Package + Version

  • [x] @sentry/browser
  • [ ] @sentry/node
  • [ ] raven-js
  • [ ] raven-node _(raven for node)_
  • [ ] other:

Version:

5.14.0

Description

After updating to 5.14.0, I had reports come in about errors not seen before.

next.js error report w/ the same message, (and related fix) which refers to the Performance API in the browser, which raised the same kind of error.

Needs Triage

Most helpful comment

@ValentinH @ipa1981 ah, nvm. My bad, I completely misread the issue (I thought it's a different one I was working on).

So apparently this is the old Safari (notice that events are using iOS 10/11) issue when DOM selector is malformed, see: https://www.reddit.com/r/firefox/comments/5nbmqi/on_handling_invalid_selector_strings/

We are not querying DOM ourselves in any way, so it's not originating from our codebase. Unfortunately, DOMError doesn't contain any additional information about it, so we're not able to tell which selector was malformed - https://developer.mozilla.org/en-US/docs/Web/API/DOMError

All 19 comments

@olleolleolle Can you update to 5.14.1 I hope this is fixed there.

I have updated to 5.14.1. Closing this issue!

Thanks for the quick turnaround time 馃悗

Have the same issue.
SDK: sentry.javascript.browser 5.15.5
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/81.0.4044.124 Mobile/15E148 Safari/604.1
OS: iOS 12.4
Browser: Chrome Mobile iOS 81.0.4044

Can confirm also experiencing this issue on multiple devices:

Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1
--
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15
--
Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Mobile/15E148 Safari/604.1
--
Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/10.0.63022 Mobile/17D50 Safari/600.1.4
--
Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone11,2;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]
--
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15

Confirming. The 5.15.5 is used. Getting errors from Safari

The same situation
Confirming. The 5.15.5 is used. Getting errors from Safari

Same issue on 5.15.5. Could you reopen this please?

Could someone provide a link to Sentry event including this error?

@ValentinH your event has no stacktrace, so there's no way to filter anything - https://sentry.io/organizations/ricardoch/issues/1531216144/events/ff765df44bab447d8fa306fca7a10635/json/

Same for you @ipa1981. Your errors have no stack trace, thus there's nothing to filter on.

Do you mean that the "syntaxError" is thrown because there is no stack trace OR that you cannot help because there is no stack trace?

@ValentinH @ipa1981 ah, nvm. My bad, I completely misread the issue (I thought it's a different one I was working on).

So apparently this is the old Safari (notice that events are using iOS 10/11) issue when DOM selector is malformed, see: https://www.reddit.com/r/firefox/comments/5nbmqi/on_handling_invalid_selector_strings/

We are not querying DOM ourselves in any way, so it's not originating from our codebase. Unfortunately, DOMError doesn't contain any additional information about it, so we're not able to tell which selector was malformed - https://developer.mozilla.org/en-US/docs/Web/API/DOMError

Thank you really much for the details. Now I understand this error :)

@kamilogorek Hi, I'm getting this error with "@sentry/react": "^5.27.1" but the solution you linked is not related to my issue since I'm not using a DOM selector in my codebase. Is there another possible reason I'm receiving this error? This is happening with Safari 12.1.2

Maybe some malformed jsx? Or one of the 3rd party packages is doing the query? Do you have an example event in Sentry that includes this error? Although I'm guessing it wont contain any stacktrace, as 2 example events above proved.

@kamilogorek Yea, it looks like the ones above where it doesn't have a stacktrace . Hard to know if it's a 3rd party package doing the query or malformed jsx. Do you recommend anything for debugging?

Other than grepping through your compiled bundle for querySelector and all getElementById variants, not really, sorry 馃槄

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hinok picture hinok  路  3Comments

grigored picture grigored  路  3Comments

jaylinski picture jaylinski  路  3Comments

dimmduh picture dimmduh  路  3Comments

rowlando picture rowlando  路  3Comments