slimphp/Slim · error · RuntimeException
%s container entry is not an object
Error message
%s container entry is not an object
What it means
Error "%s container entry is not an object" thrown in slimphp/Slim.
Source
Thrown at Slim/CallableResolver.php:137
{
return $toResolve instanceof MiddlewareInterface;
}
/**
* @throws RuntimeException
*
* @return array{object, string|null} [Instance, Method Name]
*/
private function resolveSlimNotation(string $toResolve): array
{
/** @psalm-suppress ArgumentTypeCoercion */
preg_match(CallableResolver::$callablePattern, $toResolve, $matches);
[$class, $method] = $matches ? [$matches[1], $matches[2]] : [$toResolve, null];
if ($this->container && $this->container->has($class)) {
$instance = $this->container->get($class);
if (!is_object($instance)) {
throw new RuntimeException(sprintf('%s container entry is not an object', $class));
}
} else {
if (!class_exists($class)) {
if ($method) {
$class .= '::' . $method . '()';
}
throw new RuntimeException(sprintf('Callable %s does not exist', $class));
}
$instance = new $class($this->container);
}
return [$instance, $method];
}
/**
* @param mixed $resolved
* @param mixed $toResolve
*
* @throws RuntimeExceptionView on GitHub (pinned to 80900fb39c)
When it happens
Trigger: Thrown at Slim/CallableResolver.php:137 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of slimphp/Slim@80900fb39c (2026-08-21).
Data as JSON: /api/errors/52bd10989c85abe0.
Report an issue: GitHub.