karser / KarserRecaptcha3Bundle

Google ReCAPTCHA v3 for Symfony
MIT License
158 stars 21 forks source link

Error SymfonyHttpClient::__construct(): Argument #1 ($httpClient) must be of type Symfony\Contracts\HttpClient\HttpClientInterface, null given #66

Closed Arobases-e-commerce closed 6 months ago

Arobases-e-commerce commented 7 months ago

Hello !

I m trying to use this good bundle, however my constraint Recaptcha3 is not called (i think the problem is the validation group)

When i m trying to add a validation group like this :

$builder ->add('captcha', Recaptcha3Type::class, [
            'constraints' => new Recaptcha3(['groups' => ['sylius']]),
            'action_name' => 'register',
            'locale' => 'fr'
]);

I have this error after : Karser\Recaptcha3Bundle\RequestMethod\SymfonyHttpClient::__construct(): Argument #1 ($httpClient) must be of type Symfony\Contracts\HttpClient\HttpClientInterface, null given, called in /home/chouettemauve/preprod/sylius/var/cache/dev/ContainerM8OPDeO/getKarserRecaptcha3_ValidatorService.php on line 29

Do you know what is the problem ?

Thank you :)

nexus23 commented 7 months ago

with version 0.1.24 i have the same problem within a pimcore installation with version 0.1.23 erverything is still working There is a notice in 0.1.24: Add SymfonyHttpClient new ReCaptcha request method (@norkunas ) README Symfony HttpClient integration If you have a dependency on symfony/http-client in your application then it will be automatically wired to use via RequestMethod/SymfonyHttpClient.

But this does not work

norkunas commented 7 months ago

Interesting. You both have symfony/http-client as a direct or indirect dependency but it is not wired?

costa-jeremy commented 5 months ago

Hello !

Thank you for the fix It is possible to create a tag with this modification ?

@karser Thanks

karser commented 5 months ago

@costa-jeremy done