{"record":{"id":"5fae60995593c9ce","repo":"yiisoft/yii2","slug":"unknown-bootstrapping-component-id-mixed","errorCode":null,"errorMessage":"Unknown bootstrapping component ID: $mixed","messagePattern":"Unknown bootstrapping component ID: \\$mixed","errorType":"exception","errorClass":"InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/base/Application.php","lineNumber":315,"sourceCode":"                    Yii::debug('Bootstrap with ' . get_class($component), __METHOD__);\n                }\n            }\n        }\n\n        foreach ($this->bootstrap as $mixed) {\n            $component = null;\n            if ($mixed instanceof \\Closure) {\n                Yii::debug('Bootstrap with Closure', __METHOD__);\n                if (!$component = call_user_func($mixed, $this)) {\n                    continue;\n                }\n            } elseif (is_string($mixed)) {\n                if ($this->has($mixed)) {\n                    $component = $this->get($mixed);\n                } elseif ($this->hasModule($mixed)) {\n                    $component = $this->getModule($mixed);\n                } elseif (strpos($mixed, '\\\\') === false) {\n                    throw new InvalidConfigException(\"Unknown bootstrapping component ID: $mixed\");\n                }\n            }\n\n            if (!isset($component)) {\n                $component = Yii::createObject($mixed);\n            }\n\n            if ($component instanceof BootstrapInterface) {\n                Yii::debug('Bootstrap with ' . get_class($component) . '::bootstrap()', __METHOD__);\n                $component->bootstrap($this);\n            } else {\n                Yii::debug('Bootstrap with ' . get_class($component), __METHOD__);\n            }\n        }\n    }\n\n    /**\n     * Registers the errorHandler component as a PHP error handler.","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/base/Application.php#L297-L333","documentation":"Each entry of config['bootstrap'] runs at application startup. A string entry is resolved first as an application component ($app->has($id)), then as a module ($app->hasModule($id)); if it is neither and contains no backslash (so it cannot be a class name for Yii::createObject()), the id refers to nothing known and InvalidConfigException('Unknown bootstrapping component ID: ...') is thrown. A closure entry or a backslash-containing class string never triggers this - only plain, unresolved ids do.","triggerScenarios":"'bootstrap' => ['queue'] when no 'queue' component exists; removing or renaming a component but leaving its old id in bootstrap; extension install guides (debug, gii, queue) where you copied the bootstrap line but not the matching 'components' block; expecting a module id like 'admin' to bootstrap without registering it under 'modules'.","commonSituations":"Copying bootstrap arrays between projects whose component sets differ; partial extension enabling; typos in bootstrap ids.","solutions":["Add the matching entry under 'components', e.g. 'queue' => ['class' => \\yii\\queue\\file\\Queue::class]","Or register the id under 'modules' if it is a module","Or use a fully qualified class name with a backslash ('app\\bootstrap\\SettingsLoader') so Yii::createObject() instantiates it directly","Or delete the stale entry from the bootstrap array"],"exampleFix":"// before\nreturn [\n    'bootstrap' => ['queue'],\n    'components' => [], // queue never configured\n];\n\n// after\nreturn [\n    'bootstrap' => ['queue'],\n    'components' => [\n        'queue' => ['class' => \\yii\\queue\\file\\Queue::class],\n    ],\n];","handlingStrategy":"validation","validationCode":"foreach ((array)($config['bootstrap'] ?? []) as $entry) {\n    if (is_string($entry)\n        && !isset($config['components'][$entry])\n        && !isset($config['modules'][$entry])\n        && strpos($entry, '\\\\') === false) {\n        throw new \\InvalidArgumentException(\"bootstrap entry '{$entry}' resolves to nothing\");\n    }\n}\n$app = new \\yii\\web\\Application($config);","typeGuard":null,"tryCatchPattern":"try {\n    $app = new \\yii\\web\\Application($config);\n} catch (\\yii\\base\\InvalidConfigException $e) {\n    // message starts with 'Unknown bootstrapping component ID:'\n    error_log($e->getMessage() . ' - check the bootstrap array vs components/modules');\n    throw $e;\n}","preventionTips":["Whenever you remove or rename a component, grep the bootstrap array too","Prefer fully qualified class names in bootstrap for pure bootstrappers - they fail loudly at instantiation","Boot every entry script in CI so partial extension setups fail early"],"tags":["configuration","bootstrap","application","service-locator"],"backgroundTag":"unknown-service-id","analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}