Laravel Symfony ArrayLoader not found


Got this error. I am not sure why. I guess some files got deleted maybe?

I tried to run a composer update to fix it.
Did not work. Then I deleted composer.lock and the vendor folder and ran composer install.
Still the same.

What would be the next step to try?


  Class "Symfony\Component\Translation\Loader\ArrayLoader" not found

  at C:\DSRack\gt-launcher\vendor\nesbot\carbon\src\Carbon\Translator.php:80
    76|     public function __construct($locale, Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false)
    77|     {
    78|         $this->initializing = true;
    79|         $this->directories = [__DIR__.'/Lang'];
  > 80|         $this->addLoader('array', new Translation\Loader\ArrayLoader());
    81|         parent::__construct($locale, $formatter, $cacheDir, $debug);
    82|         $this->initializing = false;
    83|     }

  1   C:\DSRack\gt-launcher\vendor\nesbot\carbon\src\Carbon\Translator.php:70

  2   C:\DSRack\gt-launcher\vendor\nesbot\carbon\src\Carbon\Traits\Localization.php:691

I’m running

  • PHP 8.0.7 (cli)
  • Locking laravel/framework (v7.30.4)
  • Locking
    symfony/translation (v5.3.8)


Temporary solution :

You can quick fix it by adding temporarily this line to your composer.json

"symfony/translation": "v5.3.7",

It’s due to a "minor" release of the package this morning

Answered By – Jeremy B.

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published