无法在角度连接peerjs

发布于 2025-01-25 17:51:24 字数 1115 浏览 3 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁把谁当真 2025-02-01 17:51:24

我解决了问题。它在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 global var ParcelRequire to pass anew appeared problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文