Failed to construct Peer Object - peerjs__WEBPACK_IMPORTED_MODULE_2__ error
See original GitHub issueI am trying to create a peer by below code:
import * as Peer from ‘peerjs’;
this.myPeerId = aaa${Math.floor((Math.random() * 10) + 1)};
this.peer = new Peer(this.myPeerId, {key: ‘lwjd5qra8257b9’});
However, I received this error: peerjs__WEBPACK_IMPORTED_MODULE_2__ is not a constructor
Anyone can help? Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Exactly what I’m facing now with Angular 7.
@frankrobert
import Peer from 'peerjs';doesn’t work. The error says that the module has no default export.The above is actually working