PS D:\Source\gitlab\voxage\nodejs\screen-peer> node .\peer-test.js
D:\Source\gitlab\voxage\nodejs\screen-peer\node_modules\peer\dist\index.cjs:273
this.socketServer = config.createWebSocketServer ? config.createWebSocketServer(options) : new (0, $cl6Iw$ws.WebSocketServer)(options);
^
TypeError: (0 , $cl6Iw$ws.WebSocketServer) is not a constructor
at new $e9ffe6de55430dbc$export$f47674b57e51ee3b (D:\Source\gitlab\voxage\nodejs\screen-peer\node_modules\peer\dist\index.cjs:273:100)
at $516a786dc008ff17$export$99152e8d49ca4e7d (D:\Source\gitlab\voxage\nodejs\screen-peer\node_modules\peer\dist\index.cjs:522:17)
at Function.<anonymous> (D:\Source\gitlab\voxage\nodejs\screen-peer\node_modules\peer\dist\index.cjs:560:55)
at Function.emit (node:events:539:35)
at Function.<anonymous> (D:\Source\gitlab\voxage\nodejs\screen-peer\node_modules\express\lib\application.js:245:8)
at Array.forEach (<anonymous>)
at Function.use (D:\Source\gitlab\voxage\nodejs\screen-peer\node_modules\express\lib\application.js:224:7)
at $123f4982a51872b4$export$f99d31af51f48b1e (D:\Source\gitlab\voxage\nodejs\screen-peer\node_modules\peer\dist\index.cjs:583:9)
at Object.<anonymous> (D:\Source\gitlab\voxage\nodejs\screen-peer\peer-test.js:4:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
I'm having an issue:
I get the error 'TypeError: (0 , $cl6Iw$ws.WebSocketServer) is not a constructor' on a simple project. what I am doing wrong please.
Version 1.0.0.0
Nodejs version v16.16.0
Platform: Windows 10 Home
I put the code and tsconfig.json file below.
code:
tsconfig.json
trace