maknz/slack

Can't use with this SDK

KingYes opened this issue · 17 comments

Hi..
I get this error:

 Catchable fatal error: Argument 1 passed to React\Promise\Promise::__construct() must be callable, null given, called in /home/yakir/slack-app/vendor/react/promise/src/Deferred.php on line 25 and defined in /home/yakir/slack-app/vendor/react/promise/src/Promise.php on line 16

That's the code:

use \Maknz\Slack\Client;

include( __DIR__ . '/vendor/autoload.php' );
$settings = [];
$client = new Client( 'my.endpoint', $settings );
$client->send( 'Test msg' );
maknz commented

Looks like something to do with React, no? If you can trace it back to a code problem in this library I'll take a look.

On Sun, May 31, 2015 at 7:29 AM, Yakir Sitbon notifications@github.com
wrote:

Hi..
I get this error:

 Catchable fatal error: Argument 1 passed to React\Promise\Promise::__construct() must be callable, null given, called in /home/yakir/slack-app/vendor/react/promise/src/Deferred.php on line 25 and defined in /home/yakir/slack-app/vendor/react/promise/src/Promise.php on line 16

That's the code:

use \Maknz\Slack\Client;
include( __DIR__ . '/vendor/autoload.php' );
$settings = [];
$client = new Client( 'my.endpoint', $settings );
$client->send( 'Test msg' );

Reply to this email directly or view it on GitHub:
#19

Nope. I don't change anything.. just download from compress.
How I can trace it back for you?

maknz commented

The stack trace you provided only mentions React, I haven't really got any reason to think there's a problem with this package.

On Sun, May 31, 2015 at 10:11 AM, Yakir Sitbon notifications@github.com
wrote:

Nope. I don't change anything.. just download from compress.

How I can trace it back for you?

Reply to this email directly or view it on GitHub:
#19 (comment)

How I can give you this log?

maknz commented

Probably around where you got your original stack trace? Further down? Above? Does it mention an error in this package somewhere?

On Sun, May 31, 2015 at 10:16 AM, Yakir Sitbon notifications@github.com
wrote:

How I can give you this log?

Reply to this email directly or view it on GitHub:
#19 (comment)

Nope. Just if I use send() method I get this error

Maybe that error cuz I run your code from WordPress?

I get log from the error, please give me your email to send you this file..

maknz commented

Paste it here man.

maknz commented

Thanks for that. Looks like a problem with Guzzle or the data we're passing to Guzzle. I'll look into it and maybe get hold of the Guzzle people to see if they have any ideas. It looks like you're doing everything correctly, though.

Okay,
Thanks.

maknz commented

Can you try specifying an older version of Guzzle to see if 5.3.0 is the problem? Try specifying "guzzlehttp/guzzle": "5.0.0" in your project's composer.json file. If that fails, try using 4.0.0.

If that works, we can fairly certainly say Guzzle is the problem, otherwise there could be an issue in how we're calling it.

maknz commented

Also, I notice you made that Gist secret, but do you mind if I provide it to the Guzzle maintainers?

Okay, I try with 5.0.0 version and same error. But with 4.0.0 it's seem work's perfect.
And you can send this to Guzzle maintainers.

maknz commented

Excellent. Change your 4.0.0 constraint to ~4.0 so you get at least the latest version of 4.x.

I've opened an issue with Guzzle, hopefully they can shed some light. I'm fairly certain there must be a problem with your environment as nobody else has had any issue with Guzzle 5, but they might have seen it before.

maknz commented

Closing this because the problem is isolated to your environment and isn't affecting other users, and the issue relates to Guzzle rather than this package.