Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
10.49.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
SDK Setup
Steps to Reproduce
- Load page using Safari 15
Expected Result
Page loads and sentry initializes
Actual Result
The bundle in which Sentry is in errors out due to syntax error (in our case it's the full page)
Additional Context
Note: we do not use the Postgres integration.
When using Sentry's CommonJS imports, it unconditionally requires the postgres integration at module load time (this is because of the export which becomes a require). The postgres integration contains a regex literal with a negative lookbehind assertion inside sanitizeSqlQuery
|
.replace(/(?<!\$)-?\b\d+\b/g, '?') // Integers (NOT $n placeholders) |
Lookbehind assertions are not supported in Safari 15 or iOS Safari < 16.4. Because this is a regex literal, the JavaScript parser rejects it at parse time, before any code executes. A SyntaxError at parse time kills the entire JS file.
The result: any bundle that includes @sentry/core via CJS becomes unparseable on Safari 15, even if the application never imports or uses the postgres integration.
Per Sentry's supported browser page, Safari is supported down to 14.
Pinning Sentry to 10.40.0 fixes the issue.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
10.49.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
SDK Setup
Steps to Reproduce
Expected Result
Page loads and sentry initializes
Actual Result
The bundle in which Sentry is in errors out due to syntax error (in our case it's the full page)
Additional Context
Note: we do not use the Postgres integration.
When using Sentry's CommonJS imports, it unconditionally requires the postgres integration at module load time (this is because of the export which becomes a require). The postgres integration contains a regex literal with a negative lookbehind assertion inside
sanitizeSqlQuerysentry-javascript/packages/core/src/integrations/postgresjs.ts
Line 381 in a87183e
Lookbehind assertions are not supported in Safari 15 or iOS Safari < 16.4. Because this is a regex literal, the JavaScript parser rejects it at parse time, before any code executes. A SyntaxError at parse time kills the entire JS file.
The result: any bundle that includes
@sentry/corevia CJS becomes unparseable on Safari 15, even if the application never imports or uses the postgres integration.Per Sentry's supported browser page, Safari is supported down to 14.
Pinning Sentry to
10.40.0fixes the issue.Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it.