'cannot connect Peerjs in angular

tsconfig.json:::

{ "compileOnSave": false,

"compilerOptions": {

"baseUrl": "./",

"outDir": "./dist/out-tsc",

"forceConsistentCasingInFileNames": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
  "es2020",
  "dom"
]

},

"angularCompilerOptions": {

"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true

} }


angular service file :::

import Peer from 'peerjs'; . . .

this.actPeer = new Peer({debug:3}) ("peerjs__WEBPACK_IMPORTED_MODULE_0___default(...).Peer is not a constructor")


import { Peer } has same warn..

a year ago same code not has a problem like this..



Solution 1:[1]

I solved the problem. It's in package.json. Using a new regular install of PeerJS solves problem. I simply must add to global var ParcelRequire to pass anew appeared problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy Caney