I am trying to deploy a brand new Laravel 9 site with Vite.
I have the site running locally just fine, and the deployment is running via Laravel forge using the default deployment script:
cd /home/forge/default
git pull origin $FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock
if [ -f artisan ]; then
$FORGE_PHP artisan migrate --force
fi
Before pushing my changes from my local to remote server, I run:
npm run build
However, when the site has been deployed to forge, I get the below error:
(Exception(code: 0): Vite manifest not found at: /home/forge/default/public/build/manifest.json at /home/forge/default/vendor/laravel/framework/src/Illuminate/Foundation/Vite.php:139)
When I ssh into my server, this is the content of the /public folder:
.
└── public/
├── favicon.ico
├── index.php
└── robots.txt
Shouldn't the /build folder be available on the production site as well, or am I missing something? Please note in my standard generated .gitignore file, these paths are excluded:
/public/build
/public/hot
/public/storage