lexik/LexikJWTAuthenticationBundle

Fatal error Trait ForwardCompatAuthenticatorTrait not found on console cache:warmup command

viktorkuk opened this issue · 1 comments

Hello.

I have encountered a problem
After update from php:8.1.16-fpm-alpine3.17 to php:8.2.16-fpm-alpine3.18 docker image
symfony version 6.3
lexik/jwt-authentication-bundle: v2.20.3

Here is Dockerfile part:

FROM php:8.2.16-fpm-alpine3.18
...
RUN --mount=type=cache,target=/root/.composer/cache composer install --no-dev --classmap-authoritative --no-scripts --no-progress
...
RUN /var/www/html/bin/console cache:warmup --no-optional-warmers

I get an error:

 > [php 4/7] RUN /var/www/html/bin/console cache:warmup --no-optional-warmers:
#36 2.880
#36 2.880         namespace Lexik\Bundle\JWTAuthenticationBundle\Security\Authenticator;
#36 2.880
#36 2.880         use Symfony\Component\HttpFoundation\Request;
#36 2.880         use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
#36 2.880
#36 2.880         /**
#36 2.880          * @internal
#36 2.880          */
#36 2.880         trait ForwardCompatAuthenticatorTrait
#36 2.880         {
#36 2.880             public function authenticate(Request $request): Passport
#36 2.880             {
#36 2.880                 return $this->doAuthenticate($request);
#36 2.880             }
#36 2.880         }
#36 2.880     PHP Fatal error:  Trait "Lexik\Bundle\JWTAuthenticationBundle\Security\Authenticator\ForwardCompatAuthenticatorTrait" not found in /var/www/html/vendor/lexik/jwt-authentication-bundle/Security/Authenticator/JWTAuthenticator.php on line 40

After some research I found that the problem only appears on x86 (tested on ubuntu 22.04) on ARM Mac or Linux the issue is not reproduced