-
Notifications
You must be signed in to change notification settings - Fork 94
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
Websocket fails to connect when Lookbook is mounted at root #63
Comments
@dmorgan-fa ah ok yes, I know why that will be - I haven't accounted for it being mounted like that, but it should definitely support it. I've got another minor websocket issue I've been meaning to look at so I'll try and get them sorted together. Thanks for the report 👍 |
@dmorgan-fa so I've spent a fair amount of time digging into this and I'm afraid to say I'm stumped :-( I've fixed a couple of (related) issues (on main, not released yet) but I just cannot figure out why ActionCable is not connecting when the engine is mounted at root. I suspect it's something to do with Lookbook being an isolated Rails engine, and without a mount path Rails is trying to connect to the ActionCable server on the parent application or something like that. I've tried everything I can think of to work around it but nothing seems to work. Very frustrating. As an aside, ActionCable is actually complete overkill for Lookbook, but I've not had much luck finding a (simpler) alternative. There is literally just a single 'updated' event that needs firing on the server and picking up on the client side so it's pretty annoying having to rely on a complex ActionCable setup. It's actually making me think I should investigate implementing an old-skool long-polling AJAX style 'socket' instead! I'll label this as |
No worries, thanks for the quick reply Mark! |
@dmorgan-fa so I believe I've finally fixed this issue 😃 The latest release (1.0.7) has a bunch of other websocket-related fixes in it, and off the back of that I thought I'd see if I could tackle this again to finally close it off. It's not released yet but I've just pushed a change to I'm going to go ahead and close this now and will include the fix the next release. Thanks again for bringing it to my attention! |
We are experiencing the same problem on version |
Hey Mark, something that I've ran into recently:
When we mount the Lookbook engine at the root of the rails app, rather than
/lookbook
, websockets fail to connect and hot reloading fails.Demo here
Console:
WebSocket connection to 'ws://cable/?uid=1646144935981' failed
Edit:
I've also checked against the latest
0.6.1
, and the problem is still present.The text was updated successfully, but these errors were encountered: