-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with Sentry Tunnel Feature in NextJS Application (ad-blockers troubleshooting) #12035
Comments
I just noticed that there is an error in the steps section. It didn't work for the Chrome browser either. It works only if the DSN is |
I believe that adblockers and Sentry have been an issue for a while. See here for more details: #2916 |
To answer your question here, I'll transfer you over to sentry-javascript as they may have more context |
Hi, thanks for writing in.
|
Self-Hosted Version
24.4.2
CPU Architecture
x64
Docker Version
20.10.16
Docker Compose Version
2.6.0
Steps to Reproduce
Hello, everyone!
I'm working on integrating Sentry into my NextJS application for error tracking and monitoring. I've opted for a self-hosted Sentry setup. However, I'm encountering issues related to ad blockers that seem to interfere with Sentry's ability to capture errors correctly.
Ad blockers are blocking Sentry's error reporting requests. As a workaround, I tried to use Sentry’s “tunnel” feature, which should tunnel the requests through my server and bypass the ad blockers. Despite following the setup instructions, this doesn't seem to be working. Errors are not being logged when ad blockers are active.
Steps to reproduce:
Configure Sentry according to the self-hosted setup documentation.
Implement the tunnel feature as advised by the Sentry docs. (for DSN and sentry host name I used my own domain name)
Add endpoint to server-side NextJS application under custom route "/api/sentry_tunnel"
The sentry configuration in
sentry.client.config.ts
,sentry.edge.config.ts
, andsentry.server.config.ts
Environment variable examples:
next.config.js
configuration:Run the project on the dev mode
Open the localhost:3000 on the Chrome browser and do some action. It works, sessions are sent to the self-hosted sentry.
Open the localhost:3000 on the Brave browser and do some action.
Expected Result
The session is sent to the self-hosted Sentry platform
Actual Result
The requests don't reach the sentry. However, when running come to this error in the console. I am not sure why it is still sent to sentry.io even if the sentry host and DSN are different.
The Network tab in the devtools shows that requests to the tunnel endpoint were sent successfully.
Event ID
No response
The text was updated successfully, but these errors were encountered: