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 1
1
import type { Event , StackFrame } from '@sentry/types' ;
2
2
import { logger } from '@sentry/utils' ;
3
3
import { spawn } from 'child_process' ;
4
- import * as inspector from 'inspector' ;
5
4
6
5
import { addGlobalEventProcessor , captureEvent , flush } from '..' ;
7
6
import { captureStackTrace } from './debugger' ;
@@ -98,12 +97,19 @@ function sendEvent(blockedMs: number, frames?: StackFrame[]): void {
98
97
} ) ;
99
98
}
100
99
100
+ interface InspectorApi {
101
+ open : ( port : number ) => void ;
102
+ url : ( ) => string | undefined ;
103
+ }
104
+
101
105
/**
102
106
* Starts the node debugger and returns the inspector url.
103
107
*
104
108
* When inspector.url() returns undefined, it means the port is already in use so we try the next port.
105
109
*/
106
110
function startInspector ( startPort : number = 9229 ) : string | undefined {
111
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
112
+ const inspector : InspectorApi = require ( 'inspector' ) ;
107
113
let inspectorUrl : string | undefined = undefined ;
108
114
let port = startPort ;
109
115
You can’t perform that action at this time.
0 commit comments