Skip to content
Advertisement

How to fix Illegal offset type in Drupal/mystore/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php:61

I’m very new to Drupal and trying to install it with composer.

My composer install went well, but now, each time I try to do something, I get this error in the console :

PHP Fatal error:  Uncaught TypeError: Illegal offset type in /srv/http/Drupal/mystore/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php:61
Stack trace:
#0 phar:///usr/bin/composer/src/Composer/DependencyResolver/PoolBuilder.php(229): ComposerDependencyResolverPool->__construct()
#1 phar:///usr/bin/composer/src/Composer/Repository/RepositorySet.php(227): ComposerDependencyResolverPoolBuilder->buildPool()
#2 phar:///usr/bin/composer/src/Composer/Installer.php(399): ComposerRepositoryRepositorySet->createPool()
#3 phar:///usr/bin/composer/src/Composer/Installer.php(247): ComposerInstaller->doUpdate()
#4 phar:///usr/bin/composer/src/Composer/Command/RequireCommand.php(323): ComposerInstaller->run()
#5 phar:///usr/bin/composer/src/Composer/Command/RequireCommand.php(243): ComposerCommandRequireCommand->doUpdate()
#6 phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php(245): ComposerCommandRequireCommand->execute()
#7 phar:///usr/bin/composer/vendor/symfony/console/Application.php(835): SymfonyComponentConsoleCommandCommand->run()
#8 phar:///usr/bin/composer/vendor/symfony/console/Application.php(185): SymfonyComponentConsoleApplication->doRunCommand()
#9 phar:///usr/bin/composer/src/Composer/Console/Application.php(310): SymfonyComponentConsoleApplication->doRun()
#10 phar:///usr/bin/composer/vendor/symfony/console/Application.php(117): ComposerConsoleApplication->doRun()
#11 phar:///usr/bin/composer/src/Composer/Console/Application.php(122): SymfonyComponentConsoleApplication->run()
#12 phar:///usr/bin/composer/bin/composer(63): ComposerConsoleApplication->run()
#13 /usr/bin/composer(24): require('phar:///usr/bin...')
#14 {main}
  thrown in /srv/http/Drupal/mystore/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php on line 61

Fatal error: Uncaught TypeError: Illegal offset type in /srv/http/Drupal/mystore/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php:61
Stack trace:
#0 phar:///usr/bin/composer/src/Composer/DependencyResolver/PoolBuilder.php(229): ComposerDependencyResolverPool->__construct()
#1 phar:///usr/bin/composer/src/Composer/Repository/RepositorySet.php(227): ComposerDependencyResolverPoolBuilder->buildPool()
#2 phar:///usr/bin/composer/src/Composer/Installer.php(399): ComposerRepositoryRepositorySet->createPool()
#3 phar:///usr/bin/composer/src/Composer/Installer.php(247): ComposerInstaller->doUpdate()
#4 phar:///usr/bin/composer/src/Composer/Command/RequireCommand.php(323): ComposerInstaller->run()
#5 phar:///usr/bin/composer/src/Composer/Command/RequireCommand.php(243): ComposerCommandRequireCommand->doUpdate()
#6 phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php(245): ComposerCommandRequireCommand->execute()
#7 phar:///usr/bin/composer/vendor/symfony/console/Application.php(835): SymfonyComponentConsoleCommandCommand->run()
#8 phar:///usr/bin/composer/vendor/symfony/console/Application.php(185): SymfonyComponentConsoleApplication->doRunCommand()
#9 phar:///usr/bin/composer/src/Composer/Console/Application.php(310): SymfonyComponentConsoleApplication->doRun()
#10 phar:///usr/bin/composer/vendor/symfony/console/Application.php(117): ComposerConsoleApplication->doRun()
#11 phar:///usr/bin/composer/src/Composer/Console/Application.php(122): SymfonyComponentConsoleApplication->run()
#12 phar:///usr/bin/composer/bin/composer(63): ComposerConsoleApplication->run()
#13 /usr/bin/composer(24): require('phar:///usr/bin...')
#14 {main}
  thrown in /srv/http/Drupal/mystore/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php on line 61

I get the feeling that this may be a compatibility issue ?

Here is my composer.json :

{
    "name": "drupalcommerce/project-base",
    "description": "Commerce 2.x project template",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "authors": [
        {
            "name": "",
            "role": ""
        }
    ],
    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "commerce_base": {
            "type": "vcs",
            "url": "https://github.com/drupalcommerce/commerce_base"
        },
        "asset-packagist": {
            "type": "composer",
            "url": "https://asset-packagist.org"
        }
    },
    "config": {
        "bin-dir": "bin",
        "sort-packages": true,
        "platform": {
            "php": "7.1.3"
        }
    },
    "require": {
        "php": ">=7.1",
        "ext-curl": "*",
        "composer/installers": "^1.2",
        "cweagans/composer-patches": "^1.6.5",
        "drupal/commerce": "^2.24",
        "drupal/core": "^8.9.0",
        "drupal/core-composer-scaffold": "^8.9.0",
        "drupal/search_api": "^1.0",
        "drupal/swiftmailer": "^2.0",
        "drupal/token": "^1.0",
        "drupalcommerce/commerce_base": "dev-8.x-1.x",
        "drush/drush": "^9.7.1 | ^10.0.0",
        "oomphinc/composer-installers-extender": "^2.0",
        "webflo/drupal-finder": "^1.0.0",
        "webmozart/path-util": "^2.3"
    },
    "require-dev": {
        "drupal/core-dev": "^8.9.0",
        "zaporylie/composer-drupal-optimizations": "^1.1"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "autoload": {
        "classmap": [
            "scripts/composer/ScriptHandler.php"
        ]
    },
    "scripts": {
        "drupal-scaffold": "DrupalComposer\DrupalScaffold\Plugin::scaffold",
        "pre-install-cmd": [
            "DrupalProject\composer\ScriptHandler::checkComposerVersion"
        ],
        "pre-update-cmd": [
            "DrupalProject\composer\ScriptHandler::checkComposerVersion"
        ],
        "post-install-cmd": [
            "DrupalProject\composer\ScriptHandler::createRequiredFiles"
        ],
        "post-update-cmd": [
            "DrupalProject\composer\ScriptHandler::createRequiredFiles"
        ]
    },
    "extra": {
        "composer-exit-on-patch-failure": true,
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-types": [
            "bower-asset",
            "npm-asset"
        ],
        "installer-paths": {
            "web/core": [
                "type:drupal-core"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ]
        }
    }
}

I have absolutely no idea how to fix this, could someone please help me ?

Advertisement

Answer

Ok, this was my mistake. I did composer selfupdate and this was over with. 🙂

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement