{"record":{"id":"76f255d7c7c1b074","repo":"slimphp/Slim","slug":"s-could-not-instantiate-a-response-factory","errorCode":null,"errorMessage":"%s could not instantiate a response factory.","messagePattern":"(.+?) could not instantiate a response factory\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Slim/Factory/Psr17/Psr17Factory.php","lineNumber":41,"sourceCode":"{\n    protected static string $responseFactoryClass;\n\n    protected static string $streamFactoryClass;\n\n    protected static string $serverRequestCreatorClass;\n\n    protected static string $serverRequestCreatorMethod;\n\n    /**\n     * {@inheritdoc}\n     */\n    public static function getResponseFactory(): ResponseFactoryInterface\n    {\n        if (\n            !static::isResponseFactoryAvailable()\n            || !(($responseFactory = new static::$responseFactoryClass()) instanceof ResponseFactoryInterface)\n        ) {\n            throw new RuntimeException(get_called_class() . ' could not instantiate a response factory.');\n        }\n\n        return $responseFactory;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public static function getStreamFactory(): StreamFactoryInterface\n    {\n        if (\n            !static::isStreamFactoryAvailable()\n            || !(($streamFactory = new static::$streamFactoryClass()) instanceof StreamFactoryInterface)\n        ) {\n            throw new RuntimeException(get_called_class() . ' could not instantiate a stream factory.');\n        }\n\n        return $streamFactory;","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/slimphp/Slim/blob/80900fb39cafce3ae53b18a2c4f642a122f03095/Slim/Factory/Psr17/Psr17Factory.php#L23-L59","documentation":"Error \"%s could not instantiate a response factory.\" thrown in slimphp/Slim.","triggerScenarios":"Thrown at Slim/Factory/Psr17/Psr17Factory.php:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"80900fb39cafce3ae53b18a2c4f642a122f03095","analyzedAt":"2026-08-21T01:41:09.580Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}