socket.io-p2p
socket.io-p2p copied to clipboard
Can't resolve stream while building
I created an Angular Project (v9.0.0) and implemented this socketio p2p library.
When i run it locally through ng serve it works like a charm.
But when I build the project (ng build) there are some problems coming up because of this library.
ERROR in ./node_modules/simple-peer/index.js
Module not found: Error: Can't resolve 'stream' in 'client/node_modules/simple-peer'
resolve 'stream' in 'client/node_modules/simple-peer'
I allready tried adding stream through yarn add stream
At least it builds at this point but I'm getting an error in my browsers console
ERROR TypeError: Cannot read property 'call' of undefined at new Peer
This error references line 29 of index.js with
stream.Duplex.call(self, opts)
I have no idea how I could fix this problem.
So I fixed the problem by running
yarn add stream@npm:readable-stream
But I'll keep this issue open