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

larsverp's avatar

Heroku error laravel Auth routes

I'm trying to deploy my site to heroku. I deployed around 3 more sites and they never caused any problems. However this site is my first site where I am using the build in Auth routes from laravel. I already tried to google this, but I can't seem to find anything about it. I'm receiving this error:

- Installing laravel/tinker (v2.4.0): Downloading (100%)
       Generating optimized autoload files
       > Illuminate\Foundation\ComposerScripts::postAutoloadDump
       > @php artisan package:discover --ansi
       
       In Auth.php line 56:
                                                                                      
         In order to use the Auth::routes() method, please install the laravel/ui pa  
         ckage.                                                                       
                                                                                      
       
       Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
 !     WARNING: A post-autoload-dump script terminated with an error
 !     ERROR: Dependency installation failed!
 !     
 !     The 'composer install' process failed with an error. The cause
 !     may be the download or installation of packages, or a pre- or
 !     post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
 !     in your 'composer.json'.
 !     
 !     Typical error cases are out-of-date or missing parts of code,
 !     timeouts when making external connections, or memory limits.
 !     
 !     Check the above error output closely to determine the cause of
 !     the problem, ensure the code you're pushing is functioning
 !     properly, and that all local changes are committed correctly.
 !     
 !     For more information on builds for PHP on Heroku, refer to
 !     https://devcenter.heroku.com/articles/php-support
 !     
 !     REMINDER: the following warnings were emitted during the build;
 !     check the details above, as they may be related to this error:
 !     - A post-autoload-dump script terminated with an error
 !     Push rejected, failed to compile PHP app.
 !     Push failed
0 likes
12 replies
larsverp's avatar

Shame on me. I really thought I already did this, so I completely skipped this step. Turns out, this is exactly what I missed

Nuel's avatar

I ran it, but I'm still getting the same error

larsverp's avatar

You have to make sure to run it on the Heroku server. Not locally. That solved the problem completely for me :)

ken4gx's avatar

How you make it to run on the heroku server ? i tried but nothing

larsverp's avatar

Go to Heroku > settings > console. From there you can execute commands. Enter the command there and the missing piece will be installed. :)

larsverp's avatar

On https://dashboard.heroku.com you can see all your current "apps" (That's how Heroku calls them). When you click on an app you're presented with the app dashboard. On here you can click the more button and click Run console. This is where you're able to run the console in your application. Good luck! :)

kenn Musembi's avatar

its not recognizing composer require laravel/ui ..help please

1 like
RjAman's avatar

command not found what should i do now please help?

1 like
RjAman's avatar

if u found any solution then please help

larsverp's avatar

Are you in the Heroku Console? And have you selected PHP/Laravel as the application type? In that case the composer command should be available.

Please or to participate in this conversation.