File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11import type { Event , StackFrame } from '@sentry/types' ;
22import { logger } from '@sentry/utils' ;
33import { spawn } from 'child_process' ;
4- import * as inspector from 'inspector' ;
54
65import { addGlobalEventProcessor , captureEvent , flush } from '..' ;
76import { captureStackTrace } from './debugger' ;
@@ -98,12 +97,19 @@ function sendEvent(blockedMs: number, frames?: StackFrame[]): void {
9897 } ) ;
9998}
10099
100+ interface InspectorApi {
101+ open : ( port : number ) => void ;
102+ url : ( ) => string | undefined ;
103+ }
104+
101105/**
102106 * Starts the node debugger and returns the inspector url.
103107 *
104108 * When inspector.url() returns undefined, it means the port is already in use so we try the next port.
105109 */
106110function startInspector ( startPort : number = 9229 ) : string | undefined {
111+ // eslint-disable-next-line @typescript-eslint/no-var-requires
112+ const inspector : InspectorApi = require ( 'inspector' ) ;
107113 let inspectorUrl : string | undefined = undefined ;
108114 let port = startPort ;
109115
You can’t perform that action at this time.
0 commit comments