socket.io-p2p icon indicating copy to clipboard operation
socket.io-p2p copied to clipboard

Can't resolve stream while building

Open DatL4g opened this issue 5 years ago • 1 comments

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.

DatL4g avatar Feb 20 '20 20:02 DatL4g

So I fixed the problem by running yarn add stream@npm:readable-stream

But I'll keep this issue open

DatL4g avatar Feb 21 '20 13:02 DatL4g