[英]cannot connect Peerjs in angular
tsconfig.json::: tsconfig.json:::
{ "compileOnSave": false, { "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';从'peerjs'导入同行; . . . . . .
this.actPeer = new Peer({debug:3}) ("peerjs__WEBPACK_IMPORTED_MODULE_0___default(...).Peer is not a constructor") this.actPeer = new Peer({debug:3}) ("peerjs__WEBPACK_IMPORTED_MODULE_0___default(...).Peer 不是构造函数")
import { Peer } has same warn.. import { Peer } 有同样的警告..
a year ago same code not has a problem like this..一年前相同的代码没有这样的问题..
I solved the problem.我解决了这个问题。 It's in package.json
.它在package.json
中。 Using a new regular install of PeerJS solves problem.使用新的常规安装 PeerJS 可以解决问题。 I simply must add to global var ParcelRequire
to pass anew appeared problem.我只需添加到全局var ParcelRequire
即可通过新出现的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.