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

jove's avatar
Level 7

Egulias\EmailValidator\EmailValidator does not exist

I'm experiencing this error at my QA server, I do not get this on my development PC.

My project is a Laravel 5.8 app upgraded to Laravel 6. I did get this also Method Illuminate\Translation\Translator::getFromJson does not exist. But this got solved with a composer dump-autoload.

Whats going on here?

[2019-09-16 09:15:02] qa.ERROR: Class Egulias\EmailValidator\EmailValidator does not exist {"exception":"[object] (ReflectionException(code: -1): Class Egulias\EmailValidator\EmailValidator does not exist at /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php:327)
[stacktrace]
#0 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(327): ReflectionClass->__construct('Egulias\\EmailVa...')
#1 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(341): Swift_DependencyContainer->createNewInstance('email.validator')
#2 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(117): Swift_DependencyContainer->createSharedInstance('email.validator')
#3 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(389): Swift_DependencyContainer->lookup('email.validator')
#4 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(366): Swift_DependencyContainer->lookupRecursive('email.validator')
#5 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(134): Swift_DependencyContainer->resolveArgs(Array)
#6 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(330): Swift_DependencyContainer->createDependenciesFor('mime.headerfact...')
#7 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(115): Swift_DependencyContainer->createNewInstance('mime.headerfact...')
#8 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(389): Swift_DependencyContainer->lookup('mime.headerfact...')
#9 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(366): Swift_DependencyContainer->lookupRecursive('mime.headerfact...')
#10 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(134): Swift_DependencyContainer->resolveArgs(Array)
#11 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(330): Swift_DependencyContainer->createDependenciesFor('mime.headerset')
#12 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(115): Swift_DependencyContainer->createNewInstance('mime.headerset')
#13 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(389): Swift_DependencyContainer->lookup('mime.headerset')
#14 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(366): Swift_DependencyContainer->lookupRecursive('mime.headerset')
#15 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(134): Swift_DependencyContainer->resolveArgs(Array)
#16 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php(48): Swift_DependencyContainer->createDependenciesFor('mime.message')
#17 [internal function]: Swift_Message->__construct()
#18 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(330): ReflectionClass->newInstanceArgs(Array)
#19 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php(115): Swift_DependencyContainer->createNewInstance('message.message')
#20 /var/www/epp/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(41): Swift_DependencyContainer->lookup('message.message')
#21 /var/www/epp/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(456): Swift_Mailer->createMessage('message')
#22 /var/www/epp/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(237): Illuminate\Mail\Mailer->createMessage()
#23 /var/www/epp/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(159): Illuminate\Mail\Mailer->send(Object(Illuminate\Support\HtmlString), Array, Object(Closure))
#24 /var/www/epp/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\Mail\Mailable->Illuminate\Mail\{closure}()
#25 /var/www/epp/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(160): Illuminate\Mail\Mailable->withLocale(NULL, Object(Closure))
#26 /var/www/epp/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(275): Illuminate\Mail\Mailable->send(Object(Illuminate\Mail\Mailer))
#27 /var/www/epp/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(229): Illuminate\Mail\Mailer->sendMailable(Object(App\Mail\ServiceMessage))
#28 /var/www/epp/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php(127): Illuminate\Mail\Mailer->send(Object(App\Mail\ServiceMessage))
#29 /var/www/epp/app/Console/Commands/PollServiceMessages.php(78): Illuminate\Mail\PendingMail->send(Object(App\Mail\ServiceMessage))
#30 [internal function]: App\Console\Commands\PollServiceMessages->handle()
#31 /var/www/epp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#32 /var/www/epp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#33 /var/www/epp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#34 /var/www/epp/vendor/laravel/framework/src/Illuminate/Container/Container.php(591): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#35 /var/www/epp/vendor/laravel/framework/src/Illuminate/Console/Command.php(192): Illuminate\Container\Container->call(Array)
#36 /var/www/epp/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#37 /var/www/epp/vendor/laravel/framework/src/Illuminate/Console/Command.php(179): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#38 /var/www/epp/vendor/symfony/console/Application.php(915): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#39 /var/www/epp/vendor/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\PollServiceMessages), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#40 /var/www/epp/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#41 /var/www/epp/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#42 /var/www/epp/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#43 /var/www/epp/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#44 {main}
"}
0 likes
11 replies
jove's avatar
Level 7

@resin I have tried twice, but there are nothing to install. Could it be installed as a dev dep? If so that would not be included on the QA as I do --no-dev

jove's avatar
Level 7

@resin a manual check shows that the folder vendor/egulias/email-validator exists but it's empty.

Sinnbeck's avatar

Can you try renaming your vendor folder and do a composer install again. Does that make a difference?

1 like
jove's avatar
jove
OP
Best Answer
Level 7

I did a rm -rf vendor/* Then composer install --no-dev It works now, does anyone have a clue why

  1. the folder was empty
  2. composer said there was nothing to be done, but as 1., there was nothing in that folder
jove's avatar
Level 7

@resin I'm gonna assume since my rm -rf worked that this would make the same result.

realtebo's avatar

I have now the same problem.

Laravel is trying to include this file

include(/var/www/html/project/vendor/composer/../egulias/email-validator/EmailValidator/EmailValidator.php): failed 

This file doesn' exists

egulias/email-validator/EmailValidator/EmailValidator.php

But exists

egulias/email-validator/src/EmailValidator.php

What's the source of this problem?

It gave me this on stage server, a debian 10, but not on dev server, identical debian 10

Note: on the server, classMap of composer is right

'Egulias\EmailValidator\EmailValidator' => $vendorDir . '/egulias/email-validator/src/EmailValidator.php',

What damn is happening?

jandante's avatar

I get this error when using the queue method on the Mail facade. When using the send method no error and the mails get send.

Did you manage to fix this?

MichMich's avatar

Seems I'm suffering from te same issue since a few days. Might be worth opening an issue in the Laravel Repo?

MichMich's avatar

Doh! For me the solution was simple:

php artisan horizon:terminate

In other words: forgot to restart horizon after a dependency update.

toipv's avatar

turn out this error come in Server. when I hit the composer update on server, the composer.json file was changed. but somehow server did not recognize the changes. so I need to restart the server supervisor systemctl restart supervisord.

Please or to participate in this conversation.