slimphp/Slim · error · RuntimeException

Middleware %s is not resolvable

Error message

Middleware %s is not resolvable

What it means

Error "Middleware %s is not resolvable" thrown in slimphp/Slim.

Source

Thrown at Slim/MiddlewareDispatcher.php:230

                        $instance = new $resolved($this->container);
                    }

                    if ($instance && $instance instanceof MiddlewareInterface) {
                        return $instance->process($request, $this->next);
                    }

                    $callable = $instance ?? $resolved;
                    if ($instance && $method) {
                        $callable = [$instance, $method];
                    }

                    if ($this->container && $callable instanceof Closure) {
                        $callable = $callable->bindTo($this->container);
                    }
                }

                if (!is_callable($callable)) {
                    throw new RuntimeException(
                        sprintf(
                            'Middleware %s is not resolvable',
                            $this->middleware
                        )
                    );
                }

                /** @var ResponseInterface */
                return $callable($request, $this->next);
            }
        };

        return $this;
    }

    /**
     * Add a (non-standard) callable middleware to the stack
     *

View on GitHub (pinned to 80900fb39c)

When it happens

Trigger: Thrown at Slim/MiddlewareDispatcher.php:230 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/8d86307b982351d3. Report an issue: GitHub.