phoenixframework / phoenix_live_view

Rich, real-time user experiences with server-rendered HTML
https://hex.pm/packages/phoenix_live_view
MIT License
6.14k stars 919 forks source link

Discordance on liveview_Version, ln295, onJoin, View.js #3321

Closed ndrean closed 3 months ago

ndrean commented 3 months ago

Environment

Actual behavior

with FIREFOX and SAFARI, but not with Chrome , I get an error message in the browsers console:

LiveView asset version mismatch. JavaScript version 0.20.15 vs. server 0.20.17. To avoid issues, please ensure that your assets use the same version as the server.

Check:

> liveSocket.version()
"0.20.15"

Expected behavior

rhcarvalho commented 3 months ago

Could it have been a browser caching issue? I've just tried to reproduce on Firefox/Linux and I get "0.20.17" as expected both on latest Chrome and Firefox.

SteffenDE commented 3 months ago

@ndrean please do check if it's a browser caching issue as @rhcarvalho mentioned. If you can still reproduce it, we'd need more information about how your asset pipeline is set up (for example: do you use the default esbuild setup from the phoenix generators, or is there something custom involved?)

ndrean commented 3 months ago

Yes, thanks for the follow-up. Basically, I reset the computer and it's gone... so your guess is correct, caching issue probably. Although I did check in a private window of course, reset node_modules, _build, deps, mix deps.update, stopped and relaunched browsers...

I indeed had a custom build.js to enable Solid.js with an esbuild plugin and esbuild does the job. I updated packages ?!

Thanks.