LiveView socket flickering on Firefox

Hey guys,

I have just started to learn how to build my first live app and noticed something. I am on a Mac OSX 13 and all works great on Safari (Version 11.0.1 ), Chrome (84.0.4147) and Opera (69.0.3686) but on Firefox (79.0) for some reason the socket connection either drops or something happens. I was doing the Counter tutorial and played with it to just try doing it differently. However i go the same result. After some more clicks on the buttons Firefox just stops updating the values. Just so you know i have not done the GenServer implementation on that tutorial - just simple @topic updates over the wire.

Same problem here…

Does your console tab shows something similar to this?

My app works fine, except for the fact that shows that failures to connect to the socket:

Firefox can't establish a connection to the server at ws://localhost:2000

But like you in other browsers it works without any issue, like in Chrome:

Maybe someone else with more knowledge of Live View can shed some pointers?

Yeah, it looks the same on desktop Firefox (Mac). But on iOS it is completely broken and LiveView can’t connect at all. I have no idea how to debug Firefox on iOS, though.

1 Like

This seems like a bug? Maybe create a bug on github?

It would also be interesting to see if this only happens with liveview, or if phx channels also have issues

I think I’ve seen this behavior too. But it seems to happen mostly on Dev. Don’t think I’ve seen it on prod.

What’s your LiveView’s version? I think phx.new use LiveView 0.12.x, try update to 0.14.x.