I had run the same deploy hooks on AWS’s elastic beanstalk since I started deploying laravel to elastic beanstalk and on a recent update it failed to deploy due to something happening with the most recent composer.
The common approach to deploy with composer on elastic beanstalk is to update composer then use it to install your packages, which worked fine until I got the following error
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning: require(/var/app/ondeck/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/app/ondeck/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required ‘/var/app/ondeck/bootstrap/../vendor/autoload.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/app/ondeck/bootstrap/autoload.php on line 17
As you can see, laravel couldn’t find the autoload file from the vendor folder which was a result of composer not running correctly
What would be the error and how to fix it.