File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { getDeviceId } from "@mongodb-js/device-id" ;
2
- import * as nodeMachineId from "node-machine-id" ;
3
2
import type { LoggerBase } from "../common/logger.js" ;
4
3
import { LogId } from "../common/logger.js" ;
5
4
@@ -17,7 +16,11 @@ export class DeviceId {
17
16
private constructor ( logger : LoggerBase , timeout : number = DEVICE_ID_TIMEOUT ) {
18
17
this . logger = logger ;
19
18
this . timeout = timeout ;
20
- this . getMachineId = ( ) : Promise < string > => nodeMachineId . machineId ( true ) ;
19
+ this . getMachineId = async ( ) : Promise < string > => {
20
+ const nodeMachineId = await import ( "node-machine-id" ) ;
21
+ const machineId = nodeMachineId . default ?. machineId || nodeMachineId . machineId ;
22
+ return machineId ( true ) ;
23
+ } ;
21
24
this . abortController = new AbortController ( ) ;
22
25
23
26
this . deviceIdPromise = DeviceId . UnknownDeviceId ;
You can’t perform that action at this time.
0 commit comments