404 on /js/app.js and /css/app.css when reloading the page

Hi there,

I just updated a few of my libraries to get started with Liveview and updated a few of my libraries:

  • phoenix 1.4.0 -> 1.4.9
  • plug 1.7.0 -> 1.8.2
  • plug_cowboy 2.0.0 -> 2.1.0
  • phoenix_html 2.6 -> 2.13
  • added phoenix_liveview

Barely no change in my code, excepted initial liveview setup. Now, when first displaying a page everything works fine (including js & css), but if I reload the page (without changing any code) I will consistently get 404 Phoenix.Router.NoRouteError errors for both my app.css and app.js assets

Any idea of what could go wrong?

1 Like

:wave:

What’s in priv/static? Does it contain app.css and app.js? What’s loaded on your first request, do the src attributes for the style/script tags change in the html when the page is reloaded?

I usually just rm -rf priv/static whenever I have problems with static assets plug.

1 Like

I don’t thing anything is going wrong with my assets (I tried the rm -rf but it didn’t fix anything)
I was able to narrow the down the problem to a phoenix issue.

My app is working properly with phoenix 1.4.2 but upgrading only this package to 1.4.3 make my css/js asset to 404 very often. Any idea why?