Skip to content

Cannot redeclare React\Promise\resolve() #23

@schmunk42

Description

@schmunk42

Hi,

we stumbled over this issue today:

PHP Fatal error:  Cannot redeclare React\Promise\resolve() (previously declared in /root/.composer/vendor/react/promise/src/functions.php:5) in /app/vendor/react/promise/src/React/Promise/functions.php on line 12
PHP Fatal error:  Cannot redeclare React\Promise\resolve() (previously declared in /root/.composer/vendor/react/promise/src/functions.php:5) in /app/vendor/react/promise/src/React/Promise/functions.php on line 12
[...]

We have a composer packages installed globally and per project which both depend on react/promise.

I think the composer autoloader always loads the file specified here which looks to me like the source of the error.

I don't know if composer should handle that...

You could wrap the definitions in a function_exists() call if you have to use the legacy files autoloading.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions