{"record":{"id":"63a119ca904c09ea","repo":"symfony/translation","slug":"s-is-neither-an-enabled-bundle-nor-a-directory","errorCode":null,"errorMessage":"\"%s\" is neither an enabled bundle nor a directory.","messagePattern":"\"(.+?)\" is neither an enabled bundle nor a directory\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Command/TranslationDebugCommand.php","lineNumber":151,"sourceCode":"                $bundle = $kernel->getBundle($input->getArgument('bundle'));\n                $bundleDir = $bundle->getPath();\n                $transPaths = [is_dir($bundleDir.'/Resources/translations') ? $bundleDir.'/Resources/translations' : $bundleDir.'/translations'];\n                $codePaths = [is_dir($bundleDir.'/Resources/views') ? $bundleDir.'/Resources/views' : $bundleDir.'/templates'];\n                if ($this->defaultTransPath) {\n                    $transPaths[] = $this->defaultTransPath;\n                }\n                if ($this->defaultViewsPath) {\n                    $codePaths[] = $this->defaultViewsPath;\n                }\n            } catch (\\InvalidArgumentException) {\n                // such a bundle does not exist, so treat the argument as path\n                $path = $input->getArgument('bundle');\n\n                $transPaths = [$path.'/translations'];\n                $codePaths = [$path.'/templates'];\n\n                if (!is_dir($transPaths[0])) {\n                    throw new InvalidArgumentException(\\sprintf('\"%s\" is neither an enabled bundle nor a directory.', $transPaths[0]));\n                }\n            }\n        } elseif ($input->getOption('all')) {\n            foreach ($kernel->getBundles() as $bundle) {\n                $bundleDir = $bundle->getPath();\n                $transPaths[] = is_dir($bundleDir.'/Resources/translations') ? $bundleDir.'/Resources/translations' : $bundle->getPath().'/translations';\n                $codePaths[] = is_dir($bundleDir.'/Resources/views') ? $bundleDir.'/Resources/views' : $bundle->getPath().'/templates';\n            }\n        }\n\n        // Extract used messages\n        $extractedCatalogue = $this->extractMessages($locale, $codePaths);\n\n        // Load defined messages\n        $currentCatalogue = $this->loadCurrentMessages($locale, $transPaths);\n\n        // Merge defined and extracted messages to get all message ids\n        $mergeOperation = new MergeOperation($extractedCatalogue, $currentCatalogue);","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Command/TranslationDebugCommand.php#L133-L169","documentation":"Validation guard in TranslationDebugCommand::execute(): the value passed to the 'bundle' argument is neither the name of a bundle registered in the kernel nor an existing filesystem directory, so no translation/code paths can be derived from it. Fires when the argument contains a typo, a bundle that is not enabled, or a path that does not exist.","triggerScenarios":"Thrown at Command/TranslationDebugCommand.php:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the exact bundle name as registered in the kernel, e.g. 'AppBundle' or the full class name 'App\\AppBundle'.","Pass an existing directory that contains the translations/views layout instead of a bundle name.","Run `php bin/console debug:router`-style discovery: use `php bin/console debug:container --parameter=kernel.bundles` (or list bundles via debug:config) to confirm the bundle is enabled."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}