-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDKType: Improvement
Description
Problem Statement
When AdBlocker ULTIMATE (Firefox) is enabled, I get the following error client-side:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://oXXXXXX.ingest.sentry.io/api/XXXXXXXX/envelope/?sentry_key=XXX&sentry_version=7. (Reason: CORS request did not succeed). Status code: (null).
Solution Brainstorm
I believe that the workaround for this would be to use NextJS rewrites
in the next.conifg.js file:
const { withSentryConfig } = require("@sentry/nextjs")
const sentryWebpackPluginOptions = { ... }
module.exports = withSentryConfig(sentryWebpackPluginOptions, {
...
rewrites: async function() {
return [
{
source: "/sentry/:path*",
// https://abcdefghijklmnopqrstquwxyzabcdef@o123456.ingest.sentry.io/1234567
destination: `https://${process.env.SENTRY_DSN.split("@")[1].split("/")[0]}/:path*`,
},
]
}
...
}
watcharaphat, raczroland, vijay-guttula, 64json and brkcrdkwatcharaphat, vijay-guttula and wzulfikar
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDKType: Improvement