cakephp / chronos

A standalone DateTime library originally based off of Carbon

Home Page:http://book.cakephp.org/chronos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Class "Cake\Chronos\Chronos" not found` when doing composer update

canvural opened this issue · comments

Hi,

This started to happen recently. I'm not directly using chronos, but I have Laravel Nova in my dependencies that is using chronos.

Full stack trace from `composer update -vvv`
[ErrorException]                        
  Class "Cake\Chronos\Chronos" not found  
                                          

Exception trace:
 () at /home/can/code/api/www/vendor/cakephp/chronos/src/carbon_compat.php:21
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 class_alias() at /home/can/code/api/www/vendor/cakephp/chronos/src/carbon_compat.php:21
 require() at phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:1425
 Composer\Autoload\composerRequire() at phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:626
 Composer\Autoload\AutoloadGenerator->createLoader() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:508
 Composer\EventDispatcher\EventDispatcher->getScriptListeners() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:455
 Composer\EventDispatcher\EventDispatcher->getListeners() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:172
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:118
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:425
 Composer\Autoload\AutoloadGenerator->dump() at phar:///usr/local/bin/composer/src/Composer/Installer.php:340
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:249
 Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:327
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:128
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:73
 require() at /usr/local/bin/composer:30

This is happening at the Generating optimized autoload files stage of Composer.

I'm sorry I cannot give any reproducible case. But I'm hoping you have some ideas how to debug this further or how to fix it.

Without a way to reproduce we won't be able to help much sorry 😞

@markstory ok I just tried again to reproduce, and it was easy 😄

  • composer create-project laravel/laravel:^8.0 chronosbug
  • cd chronosbug
  • composer require cakephp/chronos

This require command will throw the mentioned error.

Hope this helps.

Ah, now I just realized this only happens with the snapshot version of the Composer. Maybe I should open an issue there?