Anyway your JavaScript file your browser gets is quite likely from old LiveView. Now you just have to find out why this is happening. I would close all tabs and clear browser cache.
Now you have the same project, built in 2 different machines, one working, one not working. Can you compare priv/static/assets/app.js from the 2 machines. Are they the same? If not, then your esbuild did not do the right thing on the bad machine.
I cannot put the differences here because is a huge file and there are many differences
I have no idea of what can be happening with esbuild, Iām going to try to investigate and try to solve it
Iāll keep you informed if I can get any advance about it
Regards
After moving .cache to .cache.old and deleting priv/static/assets, it worked (assets where regenerated on mix phx.server correctly)
Then I deleted .cache and moved back .cache.old to .cache, and deleted again priv/static/assets in order to reproduce the problem and investigate what was producing this behavourā¦ butā¦ it didnāt fail anymore
Iāve created a new project with the āoriginal and perhaps corrupted cacheā, and everything is working fine
Perhaps, I did a mistake, and I didnāt close a browser when manipulating .cache folder. Not sure
Iām not happy because I cannot reproduce the problem and try to understand the exact point that produced it. I also was interested on checking if could be possible to have better information on phoenix side when problems arrive.
The app.js as derek-zhou detected was wrong, probably because someone (esbuild?) was getting an old and invalid version from .cache
After manipulating this folderā¦ it worked due toā¦ donāt know, could be due to updated timestamps, running applicationā¦
Thank to all of you, I learned a lot trying to understand this problem