Skip to content

Commit 96190d7

Browse files
authored
fix(nextjs): Fix Http integration type declaration (#10338)
For some reason `const { Http: OriginalHttp } = Integrations` caused weirdness around getting type imports from the local build structure instead of importing the type top-level. This patch removes the object destructuring in favour of directly referencing `Integrations.Http`.
1 parent b7af3fc commit 96190d7

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/nextjs/src/server/httpIntegration.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Integrations } from '@sentry/node';
2-
const { Http: OriginalHttp } = Integrations;
32

43
/**
54
* A custom HTTP integration where we always enable tracing.
65
*/
7-
export class Http extends OriginalHttp {
8-
public constructor(options?: ConstructorParameters<typeof OriginalHttp>[0]) {
6+
export class Http extends Integrations.Http {
7+
public constructor(options?: ConstructorParameters<typeof Integrations.Http>[0]) {
98
super({
109
...options,
1110
tracing: true,

packages/nextjs/src/server/onUncaughtExceptionIntegration.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Integrations } from '@sentry/node';
2-
const { OnUncaughtException: OriginalOnUncaughtException } = Integrations;
32

43
/**
54
* A custom OnUncaughtException integration that does not exit by default.
65
*/
7-
export class OnUncaughtException extends OriginalOnUncaughtException {
8-
public constructor(options?: ConstructorParameters<typeof OriginalOnUncaughtException>[0]) {
6+
export class OnUncaughtException extends Integrations.OnUncaughtException {
7+
public constructor(options?: ConstructorParameters<typeof Integrations.OnUncaughtException>[0]) {
98
super({
109
exitEvenIfOtherHandlersAreRegistered: false,
1110
...options,

0 commit comments

Comments
 (0)