Closed SachaG closed 1 year ago
Additional info: using @sentry/nextjs
v6 + the deprecated apiWrapper
in Next.js API routes doesn't produce this issue.
Upgrading to v7 creates the issue.
Hi, there are a lot of moving parts here. Would you mind cleanly setting up Sentry with v7 and removing all the manual wrappers? Thanks.
Also a minimal repro example would help a lot debugging this, since the actual error stems from a different lib than Sentry.
Upgrading to v7 + removing apiWrapper
still have the same issue indeed, as well as setting automatic tracing to false.
We will try to craft a minimal repro later on but for the record the error happens only when Sentry is enabled, it seems to alter the request so the Connect middleware that looks for req.url
immediately fails afterwards.
it seems to alter the request so the Connect middleware that looks for
req.url
immediately fails afterwards.
This is what confuses me a bit. The SDK is very careful in passing everything along. If that weren't the case, I think we would have had a lot more user reports mentioning this.
You can check the code here: https://github.com/getsentry/sentry-javascript/blob/develop/packages/nextjs/src/server/wrapApiHandlerWithSentry.ts
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Closing this issue for cleanup. Please re-open if this still applies. Thanks!
what's wrong
@nosirbek030381 please open a new issue with steps to reproduce.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.55.0
Framework Version
7.55.0
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
Lately our login API routes (powered by Passport) have been broken, returning an error 405 each time. Here's an example of a route that breaks:
https://github.com/Devographics/Monorepo/blob/main/surveyform/src/pages/api/account/anonymous-login/loginAndCreateResponse.ts
Commenting out the following line in
next.config.js
fixed the issue, which leads me to believe it might be related to Sentry:I think the problem started when we upgraded from Sentry 6.19.7 to 7.54.0.
Expected Result
No error.
Actual Result
Here is the log with the error: