Can you try running composer dump-autoload on heroku?
Failing Auth::routes() in Heroku, in spite of laravel/ui installations
I have been struggling to get my new Laravel project to work in Heroku, even though a past project had worked fine. I solved the usual problems, like the missing Procfile, and have attached the necessary database and app ENV variables. However, the homepage keeps giving me the same error: "In order to use the Auth::routes() method, please install the laravel/ui package." This error does not occur on my local host.
I've searched online all day for a solution, and all of them (to include posts here) point in the same direction: install laravel/ui with the command "composer require laravel/ui". But it never works, even though a) the installation seems to happen and b) the laravel/ui is found in both composer.json and /vendor. Each time, I push my changes to GitHub, and then I manually deploy to Heroku from GitHub.
To ensure that laravel/ui was actually getting to Heroku, I temporarily allowed /vendor to be push to GitHub too by removing it from the .gitignore list.
In short, I'm dumbfounded and searching for any hints about why this doesn't work. Finally, this may be the result of my recent upgrades to Laravel 9 or PHP 8, but who knows.
Okay, I may have solved the problem. Earlier in my research, I had referenced this StackOverflow ticket and added the below suggestion to the "script" in composer.json:
"post-install-cmd": [
"php artisan clear-compiled",
"chmod -R 777 public/"
]
Once I removed that code, the server let me through. It looks butt ugly at the moment because an error is telling me that the Bootstrap isn't there, but at least it's working in some way.
Please or to participate in this conversation.