new Peer only works if using window.Peer in angular application
See original GitHub issueHi.
I am importing peerjs npm package into my client-side application vie plugins capability in webpack:
... let plugins = [ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", Peer: "peerjs" ...
Until recently, I was able to just call var peer = new Peer(idService.generateId(), config.peerConfig); and the Peer object would be instantiated for me. Now with a recent update, only calling a window.Peer as a constructor results in expected behavior, while simply trying to call new Peer(... will result in Peer is not a constructor error.
Did I miss some change announcement or the way I import it is wrong for .ts-based peerjs implementation?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
npm WARN ... requires a peer of ... but none is installed. You ...
npm WARN @angular/animations@4.3.6 requires a peer of @angular/core@4.3.6 but none is installed. You must install peer dependencies yourself.
Read more >npm Peer Dependencies - JavaScript inDepth
Peer Dependencies are used to specify that our package is compatible with a specific version of an npm package. Good examples are Angular...
Read more >npm-ci
An easy way to do this is to run, for example, npm config set legacy-peer-deps=true --location=project and commit the .npmrc file to your...
Read more >Difference between dependencies, devDependencies and ...
Peer dependencies are only encountered when you publish your own package, that is, when you develop code that will be used by other...
Read more >Creating libraries - Angular
Use the Angular CLI to generate a new library skeleton in a new workspace with the following ... Refactoring parts of an application...
Read more >
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

@kidandcat you have a terrific intuition, man 👍
Importing with default property specified has fixed the problem of having to use window.Peer. Thank you.
Are you doing this?
See the Vue example: