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

what to do when WS is not a constructor? #111

Open
binarykitchen opened this issue Apr 3, 2017 · 9 comments
Open

what to do when WS is not a constructor? #111

binarykitchen opened this issue Apr 3, 2017 · 9 comments

Comments

@binarykitchen
Copy link
Contributor

for some exotic browsers i want to support, like opera, i see the WS is not a constructor error.

do you think you could add a workaround for that? if not, what else would you suggest in my place?

@binarykitchen
Copy link
Contributor Author

silly me, wrong repo. will do this in https://github.com/websockets/ws

@mcollina
Copy link
Collaborator

mcollina commented Apr 3, 2017

no worries.

@binarykitchen
Copy link
Contributor Author

sorry, reopening. moving this back here from websockets/ws#1060

i guess it has something to do with the ws-fallback.js file.

@binarykitchen binarykitchen reopened this Apr 4, 2017
@mcollina
Copy link
Collaborator

mcollina commented Apr 7, 2017

we do not have a ws-fallback here. What do you mean?

@lpinca
Copy link
Contributor

lpinca commented Apr 7, 2017

https://github.com/maxogden/websocket-stream/blob/master/ws-fallback.js

I guess the Opera version is too old, for example in 11.50 you had to enable WebSocket manually to have the WebSocket object.

@binarykitchen you should download the Opera version that is giving you troubles, open the console and check if there is a global WebSocket object available.

@binarykitchen
Copy link
Contributor Author

damn, cannot reproduce this anymore. wish i had noted down the exact opera version.

but still, i wonder what the recommendation is when ws being null is returned here https://github.com/maxogden/websocket-stream/blob/master/ws-fallback.js ?

maybe throw an exception somewhere saying that "your browser does not support WebSockets" or something like that?

@lpinca
Copy link
Contributor

lpinca commented Apr 8, 2017

maybe throw an exception somewhere saying that "your browser does not support WebSockets" or something like that?

I think it makes sense.

@limjiregister
Copy link

I got this issue too. when I used wepback4.x to build, and ran it by 'node main.js', this error happened. How to fixed it?

@dfoverdx
Copy link

@limjiregister My solution was setting the target: 'node' in my webpack.config.js file.

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

5 participants