Assets (in /priv/static/assets) not being served (Phoenix 1.6 rc 0)

I’ve converted a project as per phx-1.6-upgrade.md · GitHub. LiveView routes have stopped working because assets/app.js gets a 404. It is present in priv/static/assets.

I’ve compared the project to a new one generated with phx.new (v 1.6), and can’t see any clearly relevant difference in the obvious places (mix.exs, config.exs, dev.exs, the Plug.Static setup in endpoint.ex).

Any ideas re where else to look?

I’ve only been coding for a few months, so take this with a huge grain of salt.

Have you looked at the script tags in your app.html.heex and root.html.heex layouts?

I updated a project yesterday using the same upgrade instructions. Everything compiled correctly, but my live views weren’t working because of an error with my script tags.

1 Like

Did you add assets to your Plug.Static options in your endpoint?

2 Likes

Despite that being clearly in your instructions and having had a look there when troubleshooting, I hadn’t. What a dope. Thanks!

I even take my own advice-to-self with one of those. Thanks for the suggestion, and welcome to the forum.

1 Like