Slim 4 JWT error

Hı, I trie slim 4 and tuupola/slim-jwt-auth. Everything is good but if token is wrong error function is not return json.I get the following error
Fatal error: Uncaught RuntimeException: No PSR-7 implementation available in

$app->add(new Tuupola\Middleware\JwtAuthentication([
"secret" => "supersecretkeyyoushouldnotcommittogithub",
"error" => function ($response, $arguments) {
    $data["status"] = "error";
    $data["message"] ='error';
    return $response
        ->withHeader("Content-Type", "application/json")
        ->getBody()->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
}

]));

Did you install a PSR-7 implementation?

Yes I did.I’m use slim/psr7 ^0.4.0

isn’t this same error as you ask on stackoverflow?

"error" => function ($response, $arguments) {

should be

"error" => function ($request, $response, $arguments) {

also the error message you got is not really clear, can you add more precise details?

It’s fixed when I’m update slim 4.0.0 to 4.1.0