无法在角度连接peerjs
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 :::
从'Peerjs'import peer; 。 。 。
this.actpeer = new Peer({debug:3})(“ peerjs__webpack_imported_module_0 ___ default(...)。peer不是构造函数”)
import> import {peer}
。没有这样的问题。
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..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了问题。它在
package.json
中。使用新的常规安装PEERJS解决问题。我只需要添加到全局var Parcelrequire
以通过重新出现问题。I solved the problem. It's in
package.json
. Using a new regular install of PeerJS solves problem. I simply must add to globalvar ParcelRequire
to pass anew appeared problem.