Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ouissla's avatar

Filament, Laravel Forge and Octane not automatically loading assets

Hi, I have a Filament backend, deployed to a server using Laravel Forge with Octane.

When Forge deploys the backend, the styles are completely off. I noticed that my public/build/assets/theme-xxxx.css file is incomplete. If I run npm run build manually on the server, and reload Octane, things go back to normal, but this is was the Forge script does already

Here is what my Forge deploy script looks like:

cd /home/forge/mysite.com
git pull origin $FORGE_SITE_BRANCH

$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader

if [ -f artisan ]; then
    $FORGE_PHP artisan migrate --force
    $FORGE_PHP artisan app:update
    npm ci
    npm run build
fi

$FORGE_PHP artisan horizon:terminate

$FORGE_PHP artisan octane:reload

Any clues what's happening?

Edit: I noticed that when the build script runs on Forge the output theme files is 15kb smaller than when I run it manually on the server

0 likes
3 replies
ouissla's avatar

@tfranssen I think we got around by just changing the order of execution of the deployment script:

cd /home/forge/mysite.com
git pull origin $FORGE_SITE_BRANCH

npm i
npm run build --force

$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader

if [ -f artisan ]; then
    $FORGE_PHP artisan migrate --force
    $FORGE_PHP artisan app:update
    $FORGE_PHP artisan horizon:terminate
    $FORGE_PHP artisan octane:reload
fi

Please or to participate in this conversation.