{"record":{"id":"497454e8bf5e9176","repo":"symfony/symfony","slug":"serializer-support-cannot-be-enabled-as-the-serial","errorCode":null,"errorMessage":"Serializer support cannot be enabled as the Serializer component is not installed. Try running \"composer require symfony/serializer-pack\".","messagePattern":"Serializer support cannot be enabled as the Serializer component is not installed\\. Try running \"composer require symfony/serializer-pack\"\\.","errorType":"validation","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php","lineNumber":447,"sourceCode":"\n        $exceptionListener = $container->getDefinition('exception_listener');\n\n        $loggers = [];\n        foreach ($config['exceptions'] as $exception) {\n            if (!isset($exception['log_channel'])) {\n                continue;\n            }\n            $loggers[$exception['log_channel']] = new Reference('monolog.logger.'.$exception['log_channel'], ContainerInterface::NULL_ON_INVALID_REFERENCE);\n        }\n\n        $exceptionListener\n            ->replaceArgument(3, $config['exceptions'])\n            ->setArgument(4, $loggers)\n        ;\n\n        if ($this->readConfigEnabled('serializer', $container, $config['serializer'])) {\n            if (!class_exists(Serializer::class)) {\n                throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed. Try running \"composer require symfony/serializer-pack\".');\n            }\n\n            $this->registerSerializerConfiguration($config['serializer'], $container, $loader);\n        } else {\n            $container->getDefinition('argument_resolver.request_payload')\n                ->setArguments([])\n                ->addError('You can neither use \"#[MapRequestPayload]\" nor \"#[MapQueryString]\" since the Serializer component is not '\n                    .(class_exists(Serializer::class) ? 'enabled. Try setting \"framework.serializer.enabled\" to true.' : 'installed. Try running \"composer require symfony/serializer-pack\".')\n                )\n                ->addTag('container.error')\n                ->clearTag('kernel.event_subscriber');\n\n            $container->removeDefinition('console.command.serializer_debug');\n        }\n\n        if ($typeInfoEnabled = $this->readConfigEnabled('type_info', $container, $config['type_info'])) {\n            $this->registerTypeInfoConfiguration($config['type_info'], $container, $loader);\n        }","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/symfony/symfony/blob/698e28026c22cf35d032cdb6e800db48b1535790/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L429-L465","documentation":"Thrown by FrameworkExtension when serializer support is enabled but the symfony/serializer component is not installed. The Serializer class is required; the suggested install is `symfony/serializer-pack` which pulls the component plus normalizer/encoder dependencies.","triggerScenarios":"Setting `framework.serializer.enabled: true` while `symfony/serializer` (and its pack) is absent. Note: this also gates `#[MapRequestPayload]` / `#[MapQueryString]`, which produce a different (added-error) message when serializer is disabled rather than absent.","commonSituations":"Enabling the serializer for API endpoints on a project that pruned the dependency; a new app skeleton that didn't include the serializer pack.","solutions":["Install the pack: `composer require symfony/serializer-pack` (or `composer require symfony/serializer`).","Or disable the serializer: `framework.serializer.enabled: false` and remove usages of serializer-based features."],"exampleFix":"# before\nframework:\n    serializer:\n        enabled: true\n\n# fix option A\n#   composer require symfony/serializer-pack\n\n# fix option B\nframework:\n    serializer:\n        enabled: false","handlingStrategy":"validation","validationCode":"if (($config['serializer']['enabled'] ?? false) && !class_exists(\\Symfony\\Component\\Serializer\\Serializer::class)) {\n    throw new \\LogicException('Install symfony/serializer-pack before enabling framework.serializer.');\n}","typeGuard":"function serializerIsInstalled(): bool\n{\n    return class_exists(\\Symfony\\Component\\Serializer\\Serializer::class);\n}","tryCatchPattern":null,"preventionTips":["Run `composer require symfony/serializer-pack` before enabling the serializer.","Note that disabling serializer also disables #[MapRequestPayload]/#[MapQueryString].","CI: ensure the serializer pack is present when serializer config is enabled."],"tags":["serializer","configuration","missing-component"],"analyzedSha":"698e28026c22cf35d032cdb6e800db48b1535790","analyzedAt":"2026-08-06T23:40:49.025Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}