We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd07776 commit 31facf1Copy full SHA for 31facf1
packages/nextjs/src/utils/handlers.ts
@@ -134,7 +134,12 @@ function wrapEndMethod(origEnd: ResponseEndMethod): WrappedResponseEndMethod {
134
}
135
136
// now that our work is done, we can pop off the scope and allow the response to end
137
- currentHub.popScope();
+ if (currentHub.getScope()?.getParent() === this.__sentryScope) {
138
+ currentHub.popScope();
139
+ } else {
140
+ logger.warn('Found incorrect scope when popping. Please report this to the Sentry team.');
141
+ }
142
+
143
return origEnd.call(this, ...args);
144
};
145
0 commit comments