-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
8.34.0
Framework Version
No response
Link to Sentry event
Reproduction Example/SDK Setup
We have been getting this error in production when Sentry is initially configured:
I believe this is because of this method checking the browser can use fetch:
| new Request('http://www.example.com'); |
This has caused 1.1m errors in the last few weeks & I would like to understand if there's a reason this needs to be the http endpoint? The only issue I found somewhat related to this is about e2e tests in #15052
I have a draft PR here: #18217
Steps to Reproduce
This is my sentry.js
// @flow
import * as Sentry from "@sentry/browser"
const enabledEnvironments = ["development", "staging", "production"]
const isEnabled = enabledEnvironments.includes(process.env.TARGET_RAILS_ENV)
const commitSha = process.env.COMMIT_SHA || "unknown"
const payausUrls = [/https?:\/\/.*\.tanda\.co/, /https?:\/\/.*\.workforce\.com/]
if (isEnabled) {
Sentry.init({
dsn: "our_dsn",
release: `${commitSha}`,
environment: process.env.TARGET_RAILS_ENV,
allowUrls: payausUrls,
// This is error sampling:
// https://docs.sentry.io/platforms/javascript/configuration/options/#sample-rate
sampleRate: 1,
// No perf sampling from frontend.
// https://docs.sentry.io/platforms/javascript/configuration/options/#tracing-options
enableTracing: true,
tracesSampleRate: 0,
tracePropagationTargets: payausUrls,
ignoreErrors: [
"__gCrWeb.autofill.extractForms",
"Background Sync is disabled",
"Request failed with status code",
"__firefox__",
/maininit|\$/,
"_isMatchingDomain is not defined",
"Failed to execute 'postMessage' on 'Window':",
"AbortError",
"createError",
"node_modules",
"AxiosError", // Added but unsure it would even mute the error if it's happening during `init`
],
denyUrls: ["js.intercomcdn.com"],
beforeSend(event) {
if (event.user) {
delete event.user.username
delete event.user.email
}
return event
},
})
window.current_user && Sentry.setUser({ id: window.current_user.id })
const euUrl = /^https?:\/\/.*.?eu\.(workforce|tanda)/
const region = window.location.href.match(euUrl) ? "frankfurt" : "sydney"
Sentry.setTag("region", region)
}Expected Result
No error
Actual Result
Errors every time Sentry is initialised
Additional Context
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata
Metadata
Assignees
Projects
Status
No status