SymfonyCasts/verify-email-bundle

Cannot autowire service "App\Security\EmailVerifier"

Ultome opened this issue · 5 comments

I just ran the following commands to create an authentication system with email confirmation:

composer require symfonycasts/verify-email-bundle
composer require symfony/security-bundle
php bin/console make:user
php bin/console make:auth
php bin/console make:registration-form

My mailer is configured. I am using Symfony 5 with PHP 7.4.
I get the following error:

Cannot autowire service "App\Security\EmailVerifier": argument "$helper" of method "__construct()" references interface "SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface" but no such service exists. Did you create a class that implements this interface?

Hi @Ultome!

Hmm. I'm not sure what's going on here. It's behaving as if symfonycasts/verify-email-bundle were not installed. The error is referencing the correct interface, and if you have this bundle installed, that interface should be available. What I mean is, the generated code seems to be correct... it just seems like symfonycasts/verify-email-bundle is missing!

Could you try composer remove symfonycasts/verify-email-bundle and then composer require symfonycasts/verify-email-bundle again? I can't think of why this would be needed, but it's worth a shot.

Cheers!

It worked! Thank you so much :) great package!

Cheers!

Hi
I have same problem and conformation's email don't send

Hi @Ultome!

Hmm. I'm not sure what's going on here. It's behaving as if symfonycasts/verify-email-bundle were not installed. The error is referencing the correct interface, and if you have this bundle installed, that interface should be available. What I mean is, the generated code seems to be correct... it just seems like symfonycasts/verify-email-bundle is missing!

Could you try composer remove symfonycasts/verify-email-bundle and then composer require symfonycasts/verify-email-bundle again? I can't think of why this would be needed, but it's worth a shot.

Cheers!

hi @weaverryan I don't know why but I still got this error
I've tried to reinstall symfonycasts/verify-email-bundle but it's not working :(
Do you have any other solution or suggestion, please?