Skip to content

Commit 8a55ab2

Browse files
authored
fix(nestjs): Inline Observable type to resolve missing 'rxjs' dependency (#13166)
1 parent 964d050 commit 8a55ab2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

dev-packages/e2e-tests/test-applications/node-nestjs-basic/src/example.interceptor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
22
import * as Sentry from '@sentry/nestjs';
3+
import { Observable } from 'rxjs';
34

45
@Injectable()
56
export class ExampleInterceptor implements NestInterceptor {
6-
intercept(context: ExecutionContext, next: CallHandler) {
7+
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
78
Sentry.startSpan({ name: 'test-interceptor-span' }, () => {});
89
return next.handle().pipe();
910
}

packages/node/src/integrations/tracing/nest.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
} from '@sentry/core';
2424
import type { IntegrationFn, Span } from '@sentry/types';
2525
import { addNonEnumerableProperty, logger } from '@sentry/utils';
26-
import type { Observable } from 'rxjs';
2726
import { generateInstrumentOnce } from '../../otel/instrument';
2827

2928
interface MinimalNestJsExecutionContext {
@@ -61,6 +60,13 @@ const supportedVersions = ['>=8.0.0 <11'];
6160

6261
const sentryPatched = 'sentryPatched';
6362

63+
/**
64+
* A minimal interface for an Observable.
65+
*/
66+
export interface Observable<T> {
67+
subscribe(observer: (value: T) => void): void;
68+
}
69+
6470
/**
6571
* A NestJS call handler. Used in interceptors to start the route execution.
6672
*/

0 commit comments

Comments
 (0)