Error on Deployment: No such file for FilamentAsset
I have this in my AppServiceProvider's boot method:
and I have this in my package.json:
My deployment is failing in the
@php artisan Filament::updgrade
composer script:
copy(node_modules/js-confetti/dist/js-confetti.min.js): Failed to open stream: No such file or directory
This is with Laravel Forge.
What am I doing wrong, or what do I need to change in order for this to work? Perhaps I need to run npm install
on my server?11 Replies
Try
./node_modules/js-confetti/dist/js-confetti.min.js
Did you run npm install?
I got it to work by adding npm install to my composer post-autoload-dump script..May need to add it somewhere else though as that script I think gets run on every deployment and I don't think I need to run npm install on every deployment.
I can't just run npm install directly because the post-autoload-dump script is basically installing the project and when it doesn't complete successfully it rolls everything back, or at least that's my assumptino.
it needs to be a part of the deployment. Maybe this will help some laravel forge user in the future.
It depends how you are deploying, but you absolutely need to run npm install as you will miss off any added packages etc.
Furthermore, you should ideally sym link your deployment for zero downtime. Ploi for isntance, installs, builds in a folder then links that to prod on successful build etc.
yeah, I realized that after I said that. I have another bit I had to add to the script to run "mkdir -p resources/svg" because of the blade icons file, and I think that's one that I don't want to run on every deployment, but needs to be a part of the initial install.
surprised no one has run into that before..
that's usually done on npm run build usually
hmmm ok, so would that typically be added to the scripts section of the composer.json file, or done as a part of the actual deployment. Like in Laravel Forge (not sure if you're familiar) they have a deployment script that gets run every time, so I have all my artisan scripts in there.
Part of the deployment.... With forge it's the same, you need it as part of the deployment script
Do you have any info or a link to learn about sym linking my deployment?
Are you even using custom icons?
If you are make sure the resources/svg directory is included in your repo and not ignored.
If you aren’t then you either need to delete the blade-icons config or comment out the default set.
yeah it doesn't look like I'm using any, so I guess I'll delete the config file.