Unable to locate file in Vite manifest: resources/css/filament/admin/theme.css on Production
I am facing vite manifest error on production while deploying using forge.
15 Replies
What does your
vite.config.js
look like?
Did you run npm run build
on production?yes.. i run npm run build on production
my site frontend is react.
Looks good to me.
Did you register it in the Panel configuration as well? In your Panel Service Provider using “->vitetheme()”?
That's what probably is causing the issue
yes
i have put viteTheme in panel service
I can confirm I have the same issue, if I delete the
viteTheme
config from the PanelProvider
then its all good.
I can see that Dan has mentioned we should run composer install --no-scripts
Not sure if that is the recommended way going forward or a temporary fix.This is the recommended way. Unfortunately Vite throws an exception when it can’t find the file. Not a fan of it.
Should only be a problem on first install
Typically just long enough to forget the fix.
After the first build any composer updates should be fine.
@awcodes can confirm I got my github action working again with
--no-scripts
What I had to do though looks quite nasty to me:
Does this constitute the recommended way? Or am I doing something unnecessary?
I'd really love it if I could get away without the npm stuff, but looks like there's no other way.Confirming this also worked for me - commented out the viteTheme method call and my composer install worked fine.
Hmmm, I can't seem to un-comment though without having that issue, so don't appear to be able to use a custom theme.
Has this been reported as a bug?
I want to say Dan fixed this. But even outside of filament laravel still throws an exception without building the assets. So I’m really not sure of the best solution.
Like you can’t just run npm ci on GitHub because the filament preset won’t exist without composer install. So you can’t even really run it as a GitHub action without extra jobs. But then you’d also somehow have to make your deploy, ie through forge, to wait for that action to run first. So then you have to get into webhooks. It all seems overly complicated.
I’ve gotten to the point of just building locally and not ignoring the builds. The merge conflicts are becoming easier to work with than the CI/CD.
This is what I ended up doing as well.
I don't have this problem outside of filament, though.