Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{} is not resolvable #38

Open
NassimaZIANI opened this issue Apr 13, 2021 · 2 comments
Open

{} is not resolvable #38

NassimaZIANI opened this issue Apr 13, 2021 · 2 comments

Comments

@NassimaZIANI
Copy link

NassimaZIANI commented Apr 13, 2021

I am trying to add caching to Slim 3, I followed the instruction in https://www.slimframework.com/docs/v3/features/caching.html :

$app = new Slim\App(['settings' => $config]);
$container = $app->getContainer();
$container['cache'] = function () {
    return new \Slim\HttpCache\CacheProvider();
};
$app->add(new \Slim\HttpCache\Cache('public', 86400));

but I get the following error :

{
"message": "Slim Application Error",
"exception": [
{
"type": "RuntimeException",
"code": 0,
"message": "{} is not resolvable",
"file": "C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\CallableResolver.php",
"line": 113,
"trace": [
"#0 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\CallableResolver.php(61): Slim\CallableResolver->assertCallable(Object(Slim\HttpCache\Cache))",
"#1 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\CallableResolverAwareTrait.php(41): Slim\CallableResolver->resolve(Object(Slim\HttpCache\Cache))",
"#2 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\DeferredCallable.php(50): Slim\DeferredCallable->resolveCallable(Object(Slim\HttpCache\Cache))",
"#3 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))",
"#4 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))",
"#5 C:\Users\Mima\Desktop\file\app\server\src\classes\middlewares\TrailingSlash.php(29): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))",
"#6 [internal function]: App\Middleware\TrailingSlash->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))",
"#7 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\DeferredCallable.php(57): call_user_func_array(Object(App\Middleware\TrailingSlash), Array)",
"#8 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))",
"#9 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))",
"#10 C:\Users\Mima\Desktop\file\app\server\src\public\index.php(1047): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))",
"#11 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))",
"#12 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)",
"#13 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))",
"#14 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))",
"#15 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))",
"#16 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))",
"#17 C:\Users\Mima\Desktop\file\app\server\src\vendor\slim\slim\Slim\App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))",
"#18 C:\Users\Mima\Desktop\file\app\server\src\public\index.php(1059): Slim\App->run()",
"#19 {main}"
]
}
]
}
@smagret
Copy link

smagret commented Nov 16, 2023

2 years later and same problem here

@marcelaodev
Copy link

same, just now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants