composer create-project symfony/skeleton sf_test
cd sf_test
composer req orm
Fatal error: Uncaught TypeError: Argument 1 passed to Composer\Semver\Intervals::compactConstraint() must implement interface Composer\Semver\Constraint\ConstraintInterface, string given, called in /home/shyim/Code/sf_test/vendor/symfony/flex/src/Unpacker.php on line 146 and defined in phar:///nix/store/iwdd9qff8z6vd95z71y8n0na1pczv6wz-composer-2.0.0-RC1/libexec/composer/composer.phar/vendor/composer/semver/src/Intervals.php:139
Stack trace:
#0 /home/shyim/Code/sf_test/vendor/symfony/flex/src/Unpacker.php(146): Composer\Semver\Intervals::compactConstraint('^1.11')
#1 /home/shyim/Code/sf_test/vendor/symfony/flex/src/Command/UnpackCommand.php(79): Symfony\Flex\Unpacker->unpack(Object(Symfony\Flex\Unpack\Operation))
#2 /home/shyim/Code/sf_test/vendor/symfony/flex/src/Command/RequireCommand.php(63): Symfony\Flex\Command\UnpackCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///nix/store/iwdd9qff8z6vd95z71y8n0na1pczv6wz-composer-2.0.0-RC1/libexe in phar:///nix/store/iwdd9qff8z6vd95z71y8n0na1pczv6wz-composer-2.0.0-RC1/libexec/composer/composer.phar/vendor/composer/semver/src/Intervals.php on line 139
Also occurs when requiring api so it seems to be a general incompatibility with upcoming Composer 2 in unpacking.
Please verify that you're using the latest version of flex.
I'm closing meanwhile because this has been fixed already afaik.
Just created a project using Composer 2.0.0-RC1, it installed flex 1.9.4.
I required the orm-pack, and the failure still happens.
Thanks for the reply. I had this PR in mind https://github.com/symfony/flex/pull/672 but that's not enough apparently.
Would you mind sending a PR with the fix?
I'll have a look this afternoon & tell you if I can fix it or not.
Most helpful comment
I'll have a look this afternoon & tell you if I can fix it or not.