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

Isomorphic app support #8

Closed
ben-av opened this issue Sep 18, 2017 · 3 comments
Closed

Isomorphic app support #8

ben-av opened this issue Sep 18, 2017 · 3 comments

Comments

@ben-av
Copy link

ben-av commented Sep 18, 2017

Anyone had success using the provider on Isomorphic app?
I'm getting window is not defined error on the server side rendering

WebSocket: window.WebSocket,
                   ^
ReferenceError: window is not defined
@cpunion
Copy link
Owner

cpunion commented Sep 19, 2017

This library just wrap the ActionCable library, and ActionCable depends window.WebSocket. So just find how to use ActionCalbe/WebSocket in an Isomorphic app. I didn't use WebSocket in SSR, after searching some keywords I'm not found some solutions directly. I think maybe just make a polyfill of server side WebSocket, if you have an tiny example I can try it.

@cpunion
Copy link
Owner

cpunion commented Sep 19, 2017

https://github.com/cpunion/react-actioncable-ssr-example

Wrote a SSR example that used react-actioncable-provider, It works.

@ben-av
Copy link
Author

ben-av commented Sep 19, 2017

Thanks @cpunion, ended up using the ActionCable client directly

@ben-av ben-av closed this as completed Sep 19, 2017
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