mattkrick / fast-rtc-swarm

A full-mesh WebRTC swarm built on top of fast-rtc-peer
MIT License
107 stars 6 forks source link

.on function not found #2

Closed shd101wyy closed 5 years ago

shd101wyy commented 5 years ago

Hi there,

I was following the documentation but I was not able to use swarm.on function.

Screenshot from 2019-10-28 00-32-54

Any suggestions?

Thank you

mattkrick commented 5 years ago

i think it has to do with your ts lib. it's there.

Screen Shot 2019-10-27 at 1 12 28 PM
shd101wyy commented 5 years ago

Weird. I changed to another computer, ran yarn add @mattkrick/fast-rtc-swarm again and import it in a javascript file. I was using visual studio code, and I still couldn't see .on method. Which editor are you using? Thank you.

mattkrick commented 5 years ago

screeenshot is from webstorm. just checked vscode & it works there for me too. make sure it's a typescript file, not javascript.

Joery-M commented 1 year ago

I fixed this by running yarn add strict-event-emitter-types, this fixed it for me.