Laravel: failed to build project
Hello, I am new to Railway. I am trying to deploy laravel project from my github repo, which is a regular laravel project without using railway templates. I stumbled through this issue at ed49629d-de29-4a0d-9c17-b6d525c141d6. I tried creating railway.json file and deploy it with the following content and it did not succeed.
Problem is that I created a php file and I am using it in multiple files and to do that I used to run composer dump-autoload locally, but here it seems I cannot do it
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "version: 2 commands: build: steps: - name: install command: yarn install - name: build command: yarn build start: command: php artisan serve --host 0.0.0.0 --port $PORT dump-autoload: composer dump-autoload"
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
ERROR MESSAGE:
Generating optimized autoload files
#12 9.834 > Illuminate\Foundation\ComposerScripts::postAutoloadDump
#12 9.861 > @php artisan package:discover --ansi
#12 10.04 Error
#12 10.17 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
#12 ERROR: process "/bin/bash -ol pipefail -c composer install --ignore-platform-reqs" did not complete successfully: exit code: 1
1 Reply
Project ID:
ed49629d-de29-4a0d-9c17-b6d525c141d6