{"record":{"id":"be7631b50a6a0a9e","repo":"flarum/framework","slug":"circular-dependencies-detected-aborting-please-fix-this-by","errorCode":null,"errorMessage":"Circular dependencies detected: ... - aborting. Please fix this by disabling the extensions that are causing the circular dependencies.","messagePattern":"Circular dependencies detected: \\.\\.\\. - aborting\\. Please fix this by disabling the extensions that are causing the circular dependencies\\.","errorType":"exception","errorClass":"CircularDependenciesException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Extension/ExtensionManager.php","lineNumber":410,"sourceCode":"    {\n        $this->config->set('extensions_enabled', json_encode(array_map(function (Extension $extension) {\n            return $extension->getId();\n        }, $this->sortDependencies($enabledExtensions))));\n    }\n\n    /**\n     * Apply a topological sort to the extensions to ensure that they are in the correct order.\n     *\n     * @param Extension[] $extensions\n     * @return Extension[]\n     * @throws CircularDependenciesException\n     */\n    public function sortDependencies(array $extensions): array\n    {\n        $resolved = static::resolveExtensionOrder($extensions);\n\n        if (! empty($resolved['circularDependencies'])) {\n            throw new Exception\\CircularDependenciesException(\n                $this->getExtensionsById($resolved['circularDependencies'])->values()->all()\n            );\n        }\n\n        return $resolved['valid'];\n    }\n\n    public function isEnabled(string $extension): bool\n    {\n        $enabled = $this->getEnabledExtensions();\n\n        return isset($enabled[$extension]);\n    }\n\n    /**\n     * Returns the titles of the extensions passed.\n     *\n     * @param Extension[] $extensions","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Extension/ExtensionManager.php#L392-L428","documentation":"Thrown in ExtensionManager::sortDependencies when the topological sort (resolveExtensionOrder) detects a cycle in the enabled extensions' require/dependency graph — e.g. A requires B and B requires A. A valid load order cannot be computed, so a CircularDependenciesException is raised during extend()/setEnabledExtensions, listing the extensions in the cycle. This blocks enabling those extensions until the cycle is broken.","triggerScenarios":"Thrown at framework/core/src/Extension/ExtensionManager.php:410 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disable one of the extensions named in the circular chain to break the cycle","Ask the extension authors to fix their composer.json require declarations","Remove one of the mutually-dependent extensions if it is redundant","Re-enable extensions one at a time to identify and isolate the loop"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}