woutdp / live_svelte

Svelte inside Phoenix LiveView with seamless end-to-end reactivity
https://hexdocs.pm/live_svelte
MIT License
1.28k stars 53 forks source link

Can't get assets to load when deploying to a server (fly.io) #143

Open AlmAnderson opened 3 months ago

AlmAnderson commented 3 months ago

I've reviewed every past issue I can find on the topic.

I've gone back through every step of the installation. Everything works great locally, but for the life of me I can't get the docker / fly.io deployment to load the styling. I reviewed a past issue linking to a working docker file and tested everything I every change.

I'm mostly wondering if anyone found a solution to docker/server deployments. Or if anyone thinks of an obvious solution for me.

Here is a server log showing the GET /assets/app.css And 404 after. I assume the path is wrong or it's getting created in the wrong spot somehow.

image
davelange commented 1 month ago

I had the same issue deploying to fly.io. Fixed it by specifying the app name in the assets.deploy task (before that I had "tailwind default --minify", which resulted in a 404 also). This is what worked for me:

 "assets.deploy": [
  "tailwind real_app_name --minify",
  "cmd --cd assets node build.js --deploy",
  "phx.digest"
]