Missing Vite assets after Laravel deployment #3277
Unanswered
nickbasham
asked this question in
Help needed
Replies: 1 comment 1 reply
-
Well, figure out which assets is served and why. Use -v during deployment. Seems easy) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm pulling my hair out about this, and just hoping someone has run into a similar issue or has some ideas to point me in the right direction.
I have a Laravel app using Vite and the Laravel Vite plugin to build and package my javascript and scss/css assets. My initial deployments worked fine, but the past few times I've attempted to deploy, the assets linked in the final HTML don't match the filenames of the built assets, so they 404 and it effectively breaks the site. I'm able to perform a rollback, which corrects the issue, but when I attempt to deploy again, I run into the same issue and have to rollback again. I tried
php artisan cache:clear
andphp artisan view:clear
, to see if something from a previous release was getting carried over, but it had no effect.I thought it might be a configuration issue with my server (a VPS at Dreamhost), so I created a new dev environment on it and was able to deploy to it without any issues. I did a bunch of deploys to it, too – editing views and css/js assets, testing rollbacks, etc., and all was working flawlessly.
So at this point, I just can't figure out why deployments to my prod environment are ending up with broken links to Vite assets, but deployments to my dev environment are working fine. Both environments are on the same server with a nearly identical .env, and running against the same commit. If it's a cache issue, I'm not sure why I'm not running into the same issue in both environments.
Any pointers/guidance would be greatly appreciated, thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions