sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

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

Open olleolleolle opened this issue 6 years ago • 19 comments

  • [x] Review the documentation: https://docs.sentry.io/
  • [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
  • [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases
  • [x] https://sentry.io/organizations/kalo/issues/1544639144

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.

olleolleolle avatar Mar 11 '20 14:03 olleolleolle

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

HazAT avatar Mar 12 '20 11:03 HazAT

I have updated to 5.14.1. Closing this issue!

Thanks for the quick turnaround time 🐎

olleolleolle avatar Mar 12 '20 12:03 olleolleolle

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

Kyr avatar Apr 30 '20 13:04 Kyr

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

darcyrailip avatar Apr 30 '20 14:04 darcyrailip

Confirming. The 5.15.5 is used. Getting errors from Safari

ipa1981 avatar May 13 '20 16:05 ipa1981

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

YuraKolyada avatar May 13 '20 18:05 YuraKolyada

Same issue on 5.15.5. Could you reopen this please?

yzhou61 avatar Jun 02 '20 14:06 yzhou61

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

kamilogorek avatar Jun 03 '20 11:06 kamilogorek

@kamilogorek https://sentry.io/organizations/ricardoch/issues/1531216144/events/ff765df44bab447d8fa306fca7a10635/?project=1304722

ValentinH avatar Jun 22 '20 08:06 ValentinH

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

kamilogorek avatar Jul 06 '20 13:07 kamilogorek

https://sentry.io/organizations/enga-systems-uab/issues/1580433163/events/83c1cf7b79af43f384ef60a06c9fd267/?project=299797

ipa1981 avatar Jul 07 '20 08:07 ipa1981

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

kamilogorek avatar Jul 07 '20 09:07 kamilogorek

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 avatar Jul 07 '20 09:07 ValentinH

@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

kamilogorek avatar Jul 07 '20 10:07 kamilogorek

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

ValentinH avatar Jul 07 '20 11:07 ValentinH

@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

gigiskarlett avatar Nov 02 '20 17:11 gigiskarlett

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 avatar Nov 03 '20 09:11 kamilogorek

@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?

gigiskarlett avatar Nov 03 '20 19:11 gigiskarlett

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

kamilogorek avatar Nov 05 '20 14:11 kamilogorek