Symfony4 Error loading classes custom folder "Expected to find class... but it was not found"
composer dump-autoload --classmap-authoritative
will only work if your src
directory is present at the time you run the command.
This can be an issue with multi-stage Docker builds in particular, when you are normally only copying the composer.json
/composer.lock
into the build image.