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

TypeError: Class constructor PubSubRoom cannot be invoked without 'new' #79

Open
brailateo opened this issue Jul 19, 2020 · 2 comments
Open

Comments

@brailateo
Copy link

The docs are outdated?
The example in home page says

const room = Room(ipfs, 'room-test1')

but running node test-pubsub-1.js got

(node:26783) UnhandledPromiseRejectionWarning: TypeError: Class constructor PubSubRoom cannot be invoked without 'new'

after adding new Room got another error:

(node:26834) UnhandledPromiseRejectionWarning: TypeError: this._libp2p.pubsub.getSubscribers is not a function
at PubSubRoom._pollPeers (/old/home/teo/node_modules/ipfs-pubsub-room/src/index.js:106:49)

So , is ipfs-pubsub-room working or just the docs are outdated?
Teo

@achingbrain
Copy link
Member

The docs are outdated and the internals may need to be refactored to work with the latest libp2p.

Would you like to submit a PR?

@dai-shi
Copy link

dai-shi commented Aug 24, 2020

In my project, I use ipfs v0.48.0, and with my modification #80 it works. Not quite sure about the errors reported in this issue, though.

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

3 participants