How can I fix manifest.json not found on Laravel Cloud? I know npm run build will work correctly. But on Laravel Cloud. The first command is composer install --no-dev that command run all the things.
- Installing squirephp/countries (v3.9.0): Extracting archive
- Installing squirephp/countries-en (v3.9.0): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
In Vite.php line 934:
Vite manifest not found at: /Users/shaungbhone/Herd/testing/public/build/manifest.json
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
@shaungbhone Kind of abismal that they shipped a "zero friction" platform that will give me a 500 error when i try to ship their default landing page. Thank you for this reply.
removing /public/build from the .gitignore file also works.
If you can't generate the manifest directly on the server, you need to remove /public/build from .gitignore, generate it locally and push to the repository.
I fixed this by adding npm install before npm run build in the build commands (deployments) section in Laravel Cloud.
Kind of strange that this isn’t included by default, especially since Vite is part of the Laravel starter kit. Maybe they didn’t plan to handle frontend builds out of the box
Thanks everyone for sharing! Adding npm install before npm run build worked for me too on Laravel Cloud. Surprised it's not default, considering Vite is standard now.
By the way, I recently ran into a similar “missing step” issue while working on a digital evidence review for a case at https://www.aftermathinvestigations.com/ It’s amazing how both coding and investigations require you to catch those tiny overlooked details that make all the difference in the final outcome.