{"id":"8f16ff8c35b0491b","repo":"laravel/framework","slug":"console-component-s-not-found","errorCode":null,"errorMessage":"Console component [%s] not found.","messagePattern":"Console component \\[(.+?)\\] not found\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Console/View/Components/Factory.php","lineNumber":56,"sourceCode":"    {\n        $this->output = $output;\n    }\n\n    /**\n     * Dynamically handle calls into the component instance.\n     *\n     * @param  string  $method\n     * @param  array  $parameters\n     * @return mixed\n     *\n     * @throws \\InvalidArgumentException\n     */\n    public function __call($method, $parameters)\n    {\n        $component = '\\Illuminate\\Console\\View\\Components\\\\'.ucfirst($method);\n\n        if (! class_exists($component)) {\n            throw new InvalidArgumentException(sprintf(\n                'Console component [%s] not found.', $method\n            ));\n        }\n\n        return (new $component($this->output))->render(...$parameters);\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":64,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Console/View/Components/Factory.php#L38-L64","documentation":"Thrown by Console\\View\\Components\\Factory::__call when you invoke a method on the output factory (e.g. $this->components->foo()) whose name does not map to an existing class in Illuminate\\Console\\View\\Components. The factory builds a class name by upper-casing the first letter of the called method and checking class_exists(); if no such component class exists it throws InvalidArgumentException. The built-in components are alert, ask, askWithCompletion, bulletList, choice, confirm, info, success, error, line, secret, task, twoColumnDetail, and warn.","triggerScenarios":"Calling any undefined component method on the Factory proxy, e.g. $this->components->progress('done') or $this->components->header() inside an Artisan command, where the corresponding \\Illuminate\\Console\\View\\Components\\Progress or \\Header class is not present. Also triggered by typos: $this->components->inf() instead of info().","commonSituations":"Typo in a command that uses the new Laravel 9+ component syntax; using a component name that only exists in a newer/older framework version than the installed one; a custom command expecting a component that was never registered; copy-pasting example code from docs targeting a newer Laravel version.","solutions":["Check the method spelling against the documented component list (alert, ask, askWithCompletion, bulletList, choice, confirm, error, info, line, secret, success, task, twoColumnDetail, warn).","Run composer show laravel/framework to confirm the installed version supports the component you are calling.","Use the raw Symfony output style ($this->output->writeln or $this->info) for any message shape not covered by a built-in component.","If you need a custom component, create the class under Illuminate\\Console\\View\\Components (or extend the factory) and call a method matching its classname."],"exampleFix":"// before\n$this->components->progess('Done'); // typo\n\n// after\n$this->components->task('Done', fn () => true);","handlingStrategy":"validation","validationCode":"$component = ucfirst($method);\nif (! class_exists(\"\\\\Illuminate\\\\Console\\\\View\\\\Components\\\\{$component}\")) {\n    $this->output->writeln(\"<error>Unknown console component: {$method}</error>\");\n    return;\n}\n$this->components->{$method}(...$args);","typeGuard":"function isKnownConsoleComponent(string $method): bool\n{\n    return class_exists('\\\\Illuminate\\\\Console\\\\View\\\\Components\\\\'.ucfirst($method));\n}","tryCatchPattern":"try {\n    $this->components->{$method}($message);\n} catch (\\InvalidArgumentException $e) {\n    if (str_contains($e->getMessage(), 'Console component')) {\n        $this->output->writeln($message);\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Keep an IDE autocompletion list of the Factory's @method docblock.","Pin your laravel/framework version and read the matching docs for component names.","Add a project lint test asserting every $this->components->X call uses a whitelisted name."],"tags":["console","artisan","typo","components"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}