discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
977 stars 236 forks source link

Breaking change in ReactPHP Promise package causing TypeError in Discord PHP bot #1148

Closed gregpriday closed 1 year ago

gregpriday commented 1 year ago

Description: Upon updating my project dependencies, my Discord bot built with team-reflex/discord-php started throwing a TypeError. The error message suggests a returned value of React\Promise\Promise where an instance of React\Promise\ExtendedPromiseInterface was expected.

Steps to Reproduce:

  1. Update project dependencies with composer update.
  2. Run the Discord PHP bot.

Expected behavior: The bot runs without throwing any TypeErrors.

Actual behavior: The bot throws the following error:

Fatal error: Uncaught TypeError: Discord\Http\Drivers\React::runRequest(): Return value must be of type React\Promise\ExtendedPromiseInterface, React\Promise\Promise returned in /Users/gpriday/Projects/DiscordBotTest/vendor/discord-php/http/src/Discord/Drivers/React.php:62
Stack trace:

Further Details: The react/promise dependency updated to version v3.0.0, which seems to be causing this issue. When I lock my project to use react/promise version 2.10.*, the error is resolved and the bot operates as expected.

Environment:

key2peace commented 1 year ago

yay, after 6 years... anyways, we updated the composer.json accordingly, feel free to update and thanks for reporting