open-next icon indicating copy to clipboard operation
open-next copied to clipboard

Using sentry causes api routes to return an empty response

Open digitaltoad opened this issue 10 months ago • 3 comments

When using Sentry with Nextjs under SST, when instrumentation is enabled on API routes, be it through the autoInstrumentServerFunctions or by wrapping the api handler, the response is empty. I'm not sure if this is directly related to opennextjs or if this is an issue with sst itself but in https://github.com/opennextjs/opennextjs-aws/issues/350 it looks like opennext was causing it previously. I've created a repo to reproduce the problem https://github.com/digitaltoad/sst-opennext-sentry-issue.

digitaltoad avatar Mar 13 '25 19:03 digitaltoad

@digitaltoad Could you try enabling streaming ? Just create an open-next.config.ts file at the same place as your next config https://opennext.js.org/aws/config/simple_example#streaming-with-lambda

If this doesn't help, i'll try to take a look at it later this week

conico974 avatar Mar 19 '25 08:03 conico974

@conico974 that seemed to fix the issue.

digitaltoad avatar Mar 24 '25 18:03 digitaltoad

Ok i'll have to take another look at this, my first guess is that sentry is probably doing something wrong here, i'll have to see if we can do something about it or not.

conico974 avatar Mar 25 '25 17:03 conico974