socketio / socket.io-p2p

MIT License
1.03k stars 178 forks source link

Can't resolve stream while building #63

Open DatL4g opened 4 years ago

DatL4g commented 4 years ago

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 commented 4 years ago

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

But I'll keep this issue open