How to resolve “Composer vendor dir found in project” WARNING in Heroku?

| By Webner

Description of this Heroku warning

Git repository always contains the vendor directory. This directory should not be under version control. Only ‘composer.json’ and ‘composer.lock’ files need to be added because Heroku handles the installation of dependencies on each deploy.

heroku warning

There are some steps that should be followed to resolve this warning message.


1. First, go to your project root directory.
2. Remove the folder “vendor” from the Git index by running the command:

‘git rm -r –cached vendor/’.

Command result:
heroku warning 1

3. Add the following line to your project’s gitignore file:
heroku warning 2

4. Now, commit the changes.

Leave a Reply

Your email address will not be published. Required fields are marked *