Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

'.createServer' is undefined in browser #70

Closed
mkg20001 opened this issue Jan 23, 2018 · 2 comments
Closed

'.createServer' is undefined in browser #70

mkg20001 opened this issue Jan 23, 2018 · 2 comments
Assignees

Comments

@mkg20001
Copy link
Member

The .createServer function should exist in the browser and return an error in the callback if called instead of simply being undefined

@dryajov
Copy link
Member

dryajov commented Jan 23, 2018

I'm guessing that the listener should not be loaded in browsers at all, take a look at the websocket transport and how its loaded in libp2p - the dialer part is always loaded, but the listener doesn't get instantiated in the browser.

@daviddias daviddias added status/ready Ready to be worked kind/support A question or request for support labels Feb 5, 2018
@mkg20001
Copy link
Member Author

I was talking about replacing it with a function in the browser like function createServer() { throw new Error('WebSockets servers can\'t be created in the browser'); } instead of replacing the function with undefined and causing confusing error messages to appear in the browser.

@ghost ghost assigned mkg20001 Apr 3, 2018
@ghost ghost added status/in-progress In progress and removed status/ready Ready to be worked labels Apr 3, 2018
@mkg20001 mkg20001 removed the kind/support A question or request for support label Apr 3, 2018
@ghost ghost removed the status/in-progress In progress label Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants