{"record":{"id":"5a197354e22ea6f4","repo":"symfony/http-kernel","slug":"the-s-renderer-does-not-exist","errorCode":null,"errorMessage":"The \"%s\" renderer does not exist.","messagePattern":"The \"(.+?)\" renderer does not exist\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Fragment/FragmentHandler.php","lineNumber":74,"sourceCode":"\n    /**\n     * Renders a URI and returns the Response content.\n     *\n     * Available options:\n     *\n     *  * ignore_errors: true to return an empty string in case of an error\n     *\n     * @throws \\InvalidArgumentException when the renderer does not exist\n     * @throws \\LogicException           when no main request is being handled\n     */\n    public function render(string|ControllerReference $uri, string $renderer = 'inline', array $options = []): ?string\n    {\n        if (!isset($options['ignore_errors'])) {\n            $options['ignore_errors'] = !$this->debug;\n        }\n\n        if (!isset($this->renderers[$renderer])) {\n            throw new \\InvalidArgumentException(\\sprintf('The \"%s\" renderer does not exist.', $renderer));\n        }\n\n        if (!$request = $this->requestStack->getCurrentRequest()) {\n            throw new \\LogicException('Rendering a fragment can only be done when handling a Request.');\n        }\n\n        return $this->deliver($this->renderers[$renderer]->render($uri, $request, $options));\n    }\n\n    /**\n     * Delivers the Response as a string.\n     *\n     * When the Response is a StreamedResponse, the content is streamed immediately\n     * instead of being returned.\n     *\n     * @return string|null The Response content or null when the Response is streamed\n     *\n     * @throws \\RuntimeException when the Response is not successful","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/symfony/http-kernel/blob/aa3a39d7286a62cdfea98f0e69c651a3da6e36cf/Fragment/FragmentHandler.php#L56-L92","documentation":"FragmentHandler::render() throws InvalidArgumentException when the requested renderer name is not registered in the handler's renderers map. The renderer registry is keyed by strategy name (e.g. 'esi', 'ssi', 'inline'), so an unknown key means the strategy was never registered in the constructor.","triggerScenarios":"Calling $handler->render($uri, 'esi') when no EsiRenderer was passed to FragmentHandler's constructor, or a typo in the renderer name ('inline' vs 'insline').","commonSituations":"Misconfigured fragment rendering setup, switching strategies without registering the matching renderer, or copying code that uses a strategy the app never installed.","solutions":["Register the renderer: pass it to new FragmentHandler($urlGenerator, [$rendererName => $renderer, ...], $requestStack).","Verify the renderer name key matches the string passed as $renderer to render().","Check that the Symfony HttpKernel Fragment bundle config enables the strategy you are calling."],"exampleFix":"// before\n$handler = new FragmentHandler($requestStack);\n$handler->render('/_fragment/foo', 'esi');\n// after\n$handler = new FragmentHandler($requestStack, ['esi' => new EsiRenderer($uriSigner)]);\n$handler->render('/_fragment/foo', 'esi');","handlingStrategy":"validation","validationCode":"if (!in_array($renderer, ['inline', 'esi', 'ssi'], true)) { throw new \\InvalidArgumentException(\"Unknown renderer: $renderer\"); }","typeGuard":"function isValidRenderer(string $r): bool { return isset($renderers[$r]); }","tryCatchPattern":null,"preventionTips":["Keep renderer names as class constants to avoid typos","Register all renderers in one central service definition","Assert renderer availability in smoke tests"],"tags":["php","symfony","fragment","configuration"],"backgroundTag":"invalid-argument-value","analyzedSha":"aa3a39d7286a62cdfea98f0e69c651a3da6e36cf","analyzedAt":"2026-09-13T18:03:36.509Z","contentChangedAt":"2026-09-13T18:03:36.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}