Skip to content

Fatal error: react/promise declaration when running command #246

@BrianHenryIE

Description

@BrianHenryIE

Bug Report

Describe the current, buggy behavior

% wp scaffold package rocket/info

Success: Created package files in /Users/brianhenry/.wp-cli/packages/local/rocket/info
Success: Created package test files.
Success: Created package readme.
Success: Created package GitHub configuration.
Installing package rocket/info (dev-main || dev-master || dev-trunk)
Updating /Users/brianhenry/.wp-cli/packages/composer.json to require the package...
Registering /Users/brianhenry/.wp-cli/packages/local/rocket/info as a path repository...
Using Composer to install the package...
---
Loading composer repositories with package information
PHP Fatal error:  Declaration of React\Promise\Internal\FulfilledPromise::then(?callable $onFulfilled = null, ?callable $onRejected = null): React\Promise\PromiseInterface must be compatible with React\Promise\PromiseInterface::then(?callable $onFulfilled = null, ?callable $onRejected = null, ?callable $onProgress = null) in /Users/brianhenry/.wp-cli/packages/vendor/react/promise/src/Internal/FulfilledPromise.php on line 37

Fatal error: Declaration of React\Promise\Internal\FulfilledPromise::then(?callable $onFulfilled = null, ?callable $onRejected = null): React\Promise\PromiseInterface must be compatible with React\Promise\PromiseInterface::then(?callable $onFulfilled = null, ?callable $onRejected = null, ?callable $onProgress = null) in /Users/brianhenry/.wp-cli/packages/vendor/react/promise/src/Internal/FulfilledPromise.php on line 37

Describe how other contributors can replicate this bug

cat ~/.wp-cli/packages/composer.json 
{
    "name": "wp-cli/wp-cli",
    "description": "Installed community packages used by WP-CLI",
    "version": "2.11.0",
    "authors": [
        {
            "name": "WP-CLI",
            "email": "[email protected]"
        }
    ],
    "homepage": "https://wp-cli.org/package-index/",
    "require": {
        "wp-cli/dist-archive-command": "@stable",
        "wp-cli/scaffold-package-command": "dev-main || dev-master || dev-trunk"
    },
    "require-dev": {},
    "minimum-stability": "dev",
    "prefer-stable": true,
    "license": "MIT",
    "repositories": {
        "wp-cli": {
            "type": "composer",
            "url": "https://wp-cli.org/package-index/"
        }
    },
    "config": {
        "secure-http": true
    }
}

Also tried with @stable

Describe what you would expect as the correct outcome

Let us know what environment you are running this on

OS:	Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64
Shell:	/bin/zsh
PHP binary:	/opt/homebrew/Cellar/[email protected]/7.4.33_6/bin/php
PHP version:	7.4.33
php.ini used:	/opt/homebrew/etc/php/7.4/php.ini
MySQL binary:	/opt/homebrew/bin/mysql
MySQL version:	mysql from 11.3.2-MariaDB, client 15.2 for osx10.19 (arm64) using  EditLine wrapper
SQL modes:	STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/Users/brianhenry/.wp-cli/packages
WP-CLI packages dir:	/Users/brianhenry/.wp-cli/packages/
WP-CLI cache dir:	/Users/brianhenry/.wp-cli/cache
WP-CLI global config:	
WP-CLI project config:	
WP-CLI version:	2.11.0

Provide a possible solution

Maybe the required package is locked and a bugfix version is available?

Provide additional context/Screenshots

Same issue under PHP 8.3 and 7.4 and on another machine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions