Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic type 'EventEmitter<EventTypes>' requires between 0 and 1 type arguments. #27

Closed
cfortuner opened this issue Jun 12, 2020 · 4 comments

Comments

@cfortuner
Copy link

node_modules/@geckos.io/server/lib/wrtc/channel.d.ts(11,19): error TS2707: Generic type 'EventEmitter' requires between 0 and 1 type arguments.

Getting an error on the new version 1.5?

@cfortuner
Copy link
Author

Also, I don't see the new channel.onDrop either. Has it been released?

@yandeu
Copy link
Member

yandeu commented Jun 12, 2020

node_modules/@geckos.io/server/lib/wrtc/channel.d.ts(11,19): error TS2707: Generic type 'EventEmitter' requires between 0 and 1 type arguments.

I guess this is the same as #22?

Also, I don't see the new channel.onDrop either. Has it been released?

Yes, I just tested it and it works. Add the following to your server to test it:

// server.js
const interval = setInterval(() => {
  channel.raw.emit(Buffer.alloc(32 * 1024))
}, 0)

setTimeout(() => {
  clearInterval(interval)
}, 5000)

channel.onDrop(drop => {
  console.log(drop.reason)
})

@cfortuner
Copy link
Author

primus/eventemitter3#224

I was able to fix this by manually installing eventemitter3@4.0.4. (I uninstalled after and then my package lock was able to use 4.0.4 for geckos.) For some reason, npm upgrade geckos@1.5.0 didn't respect the ^4.0.0 here and fetch the latest version of eventemitter3@4.04

This isn't an issue for me anymore but I'd be curious if you might know why this happened?

@cfortuner
Copy link
Author

Also, I am now seeing onDrop! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants