You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(nextjs): Stop injecting sentry into API middleware (getsentry#4517)
During the build of a nextjs app, our SDK injects the user's `sentry.server.config.js` (which contains the call to `Sentry.init()`) into all API routes, so that `withSentry` will work. That said, we don't yet support nextjs middleware[1], so we shouldn't be injecting the file into middleware pages, even if they're in the `api/` folder.
This prevents that by adding another condition to `shouldAddSentryToEntryPoint`.
Note: This came up as part of the issue referenced below, and it does fix it, but only in a temporary way. The underlying issue is (I believe) something outside of sentry. I've encouraged the user to debug it, so that when we start supporting middleware (and therefore remove this filter), he doesn't run into problems again. See this comment: getsentry#4507 (comment).
Fixesgetsentry#4507.
[1] https://nextjs.org/docs/middleware
0 commit comments