{"record":{"id":"f6cdb1e1d04ec52d","repo":"symfony/var-dumper","slug":"unsupported-format-s","errorCode":null,"errorMessage":"Unsupported format \"%s\".","messagePattern":"Unsupported format \"(.+?)\"\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Command/ServerDumpCommand.php","lineNumber":82,"sourceCode":"                  <info>php %command.full_name%</info>\n\n                You can consult dumped data in HTML format in your browser by providing the <info>--format=html</info> option\n                and redirecting the output to a file:\n\n                  <info>php %command.full_name% --format=\"html\" > dump.html</info>\n\n                EOF\n            )\n        ;\n    }\n\n    protected function execute(InputInterface $input, OutputInterface $output): int\n    {\n        $io = new SymfonyStyle($input, $output);\n        $format = $input->getOption('format');\n\n        if (!$descriptor = $this->descriptors[$format] ?? null) {\n            throw new InvalidArgumentException(\\sprintf('Unsupported format \"%s\".', $format));\n        }\n\n        $errorIo = $io->getErrorStyle();\n        $errorIo->title('Symfony Var Dumper Server');\n\n        $this->server->start();\n\n        $errorIo->success(\\sprintf('Server listening on %s', $this->server->getHost()));\n        $errorIo->comment('Quit the server with CONTROL-C.');\n\n        $this->server->listen(static function (Data $data, array $context, int $clientId) use ($descriptor, $io) {\n            $descriptor->describe($io, $data, $context, $clientId);\n        });\n\n        return 0;\n    }\n\n    public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/symfony/var-dumper/blob/e9d9cf5dcdd4b1b13b4504aaffd66ce4ddb5684e/Command/ServerDumpCommand.php#L64-L100","documentation":"VarDumpServer's dump command supports only the formats registered in its $descriptors map (cli, html). When the --format option value has no registered descriptor, the command aborts with an InvalidArgumentException before starting the dump server.","triggerScenarios":"Running `bin/console server:dump --format=<unsupported>` where <unsupported> is not 'cli' or 'html', e.g. a typo like --format=json or a format removed in a newer var-dumper version.","commonSituations":"Copy-pasting a --format value from docs of another tool (e.g. --format=json), CI scripts with typos, or following outdated tutorials referencing formats that no longer exist.","solutions":["Use a supported format: --format=cli (default) or --format=html","Run `bin/console server:dump --help` to list the formats available in your installed var-dumper version","Fix the typo in your script or alias config that sets the format"],"exampleFix":"// before\n$php bin/console server:dump --format=json\n// after\n$php bin/console server:dump --format=html","handlingStrategy":"validation","validationCode":"$formats = ['cli', 'html'];\n$format = $input->getOption('format');\nif (!in_array($format, $formats, true)) {\n    throw new \\InvalidArgumentException(sprintf('Format must be one of: %s, got \"%s\".', implode(', ', $formats), $format));\n}","typeGuard":"if (!is_string($format) || !isset($descriptors[$format])) { /* reject */ }","tryCatchPattern":"try {\n    $command->run($input, $output);\n} catch (\\InvalidArgumentException $e) {\n    $io->error($e->getMessage());\n    $io->note('Supported formats: cli, html');\n    return Command::FAILURE;\n}","preventionTips":["Validate --format against in_array before invoking the command","Read --help output for the exact accepted formats per installed version","Pin format values in config constants instead of free-text strings"],"tags":["cli","invalid-input","symfony"],"backgroundTag":"invalid-cli-argument","analyzedSha":"e9d9cf5dcdd4b1b13b4504aaffd66ce4ddb5684e","analyzedAt":"2026-09-14T11:19:53.665Z","contentChangedAt":"2026-09-14T11:19:53.665Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}