diff --git a/src/platforms/javascript/common/troubleshooting/index.mdx b/src/platforms/javascript/common/troubleshooting/index.mdx index 932692f7bdf7a..795e3a910d54c 100644 --- a/src/platforms/javascript/common/troubleshooting/index.mdx +++ b/src/platforms/javascript/common/troubleshooting/index.mdx @@ -449,3 +449,38 @@ export default defineConfig({ plugins: [react()] }) ``` + + + +## Vercel Experimental Edge Runtime + +The Sentry Next.js SDK does not yet support the [Vercel Edge Runtime](https://vercel.com/docs/concepts/functions/edge-functions) which is used in Next.js middleware and Edge Routes when deployed on Vercel. +If you want to use the Edge Runtime in combination with the Sentry SDK you need to manually opt the API routes that use the Edge Runtime out of Sentry instrumentation via the `excludedServersideEntrypoints` option in your `next.config.js`. + +For example: Opting out the route `/api/posts` and all the routes starting with `/api/users/` will work like the following. + +```javascript {filename:next.config.js} +const { withSentryConfig } = require("@sentry/nextjs"); + +const nextConfig = { + // Next.js configuration options... + + sentry: { + excludedServersideEntrypoints: [ + "pages/api/posts", + /^pages\/api\/users\/.*/, + ], + // Other optional Sentry build-time configuration options... + }, +}; + +const sentryWebpackPluginOptions = { + // Sentry Webpack Plugin options... +}; + +module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions); +``` + +Please note that this will effectively disable the Sentry SDK for these API routes - removing all error and performance monitoring. + +