Skip to main content

[NextJS] Errors sending events to /monitoring

Updated over a month ago

Issue

NextJS SDK is not sending events.

Sentry's NextJS SDK adds a tunnel option in the next.config.js file by default. This option is to prevent ad-blockers from dropping events sent by the SDK to the project.

tunnelRoute:"/monitoring"

In some cases, all requests to this endpoint will fail (checking the browser's network tab).

Applies To

  • All Sentry plans.

  • Customers using NextJS installed via sentry wizard.

  • Customers using the tunnel option in NextJS

Symptoms

  • Requests to /monitoring result in 500, 401, 403, etc....

Resolution

The usual root causes are:

  • You have a custom middleware

  • Hosting server/platform settings

If you are using a custom middleware, the solution is to add the /monitoring endpoint to the list of endpoints ignored by the middleware. In case the changes are not taking effect, delete the build cache and/or the ".next" folder.

If the issue only affects production (or does not affect localhost) and you are not using a custom middleware, the issue is most likely on your hosting server/platform. Please contact your hosting platform administrator for more details.

You can find additional resources on these links:

Did this answer your question?