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

khanhdoan's avatar

28th Sep - Can't install nor update Laravel

Hey, it's just happened a few minutes ago. Suddenly I can't update nor install a Laravel project. I thought it was a problem in my localhost but then I tried to deploy in a brand new Ubuntu server and still the same error. Not sure if it's only me or anyone else faces this problem.

Class Symfony\Component\Translation\Tests\Loader\IcuResFileLoaderTest located in ./vendor/symfony/translation/IcuResFileLoaderTest.php does not comply with psr-4 autoloading standard. Skipping.

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi

Error

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

at 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▕ } 84▕

  +13 vendor frames 

14 [internal]:0 Illuminate\Foundation\Application::Illuminate\Foundation{closure}()

  +5 vendor frames 

20 artisan:37 Illuminate\Foundation\Console\Kernel::handle() Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

0 likes
22 replies
khanhdoan's avatar

composer create-project laravel/laravel example-app or whatever composer update, composer install... something went wrong

ehben's avatar

Yes - I have the same.

It's since the update of the Symfony/Translation package. It broke things.

Sinnbeck's avatar

@ehben Same issue. Carbon uses symfony, which released a minor version with breaking changes sadly.

1 like
laracastsluvr's avatar

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

and also getting tons of complaining from composer

Class Symfony\Component\Translation\***** does not comply with psr-4 autoloading standard. Skipping.
khanhdoan's avatar
khanhdoan
OP
Best Answer
Level 1

Well, just a tmp hack to continue coding till Symfony or Laravel fix this problem. Just add this to your composer.json file

"require": {
    .....
    "symfony/translation": "5.3.7"
}
3 likes
khanhdoan's avatar

HOLY F*KING CRAP! I have a production project which automatically sync code from Github and runs "composer update" every 5 minutes, and this thing broke the whole product

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

I think this update from Symfony would also break tons of websites like mine too!

1 like
Sinnbeck's avatar

It is now fixed! Clear cache and try again

composer clearcache
2 likes
laracastsluvr's avatar

It is fixed. Do composer upgrades for anyone with the problem

Please or to participate in this conversation.