php websocket报错:Unhandled promise rejection with TypeError: React\Http\Io\ClientRequestStream::closeError(): Argument #1 ($error) must be of type Exception, TypeError given, called in

380
0

运行PHP websocket时,报错:Unhandled promise rejection with TypeError: React\Http\Io\ClientRequestStream::closeError(): Argument #1 ($error) must be of type Exception, TypeError given, called in

如下:

php artisan websocket:serve
cli beginStarting the WebSocket server on port 6001...
Unhandled promise rejection with TypeError: React\Http\Io\ClientRequestStream::closeError(): Argument #1 ($error) must be of type Exception, TypeError given, called in /vendor/react/promise/src/Internal/RejectedPromise.php on line 73 in /vendor/react/http/src/Io/ClientRequestStream.php:238
Stack trace:
#0 /vendor/react/promise/src/Internal/RejectedPromise.php(73): React\Http\Io\ClientRequestStream->closeError()
#1 /

解决办法:composer require react/promise:^2.3

指定react/promise版本后,问题解决。

参考:https://github.com/beyondcode/laravel-websockets/issues/1139

Leave a Reply

Your email address will not be published. Required fields are marked *