{"record":{"id":"670ca2794f541e6c","repo":"squidfunk/mkdocs-material","slug":"couldn-t-find-project-slug","errorCode":null,"errorMessage":"Couldn't find project '{slug}'","messagePattern":"Couldn't find project '(.+?)'","errorType":"exception","errorClass":"PluginError","httpStatus":null,"severity":"error","filePath":"src/plugins/projects/plugin.py","lineNumber":289,"sourceCode":"        # Compute slug from host name and convert to dot notation\n        slug = url.hostname\n        slug = slug if slug.startswith(\".\") else f\".{slug}\"\n\n        # Resolve source and target project\n        source: Project | None = None\n        target: Project | None = None\n        for ref, file in self.manifest.items():\n            base = os.path.join(self.config.projects_root_dir, file)\n            if file == os.path.relpath(\n                config.config_file_path, self.config.projects_root_dir\n            ):\n                source = Project(base, self.config, ref)\n            if slug == ref:\n                target = Project(base, self.config, ref)\n\n        # Abort if slug doesn't match a known project\n        if not target:\n            raise PluginError(f\"Couldn't find project '{slug}'\")\n\n        # Return project slug and path\n        return target, target.path(source)\n","sourceCodeStart":271,"sourceCodeEnd":293,"githubUrl":"https://github.com/squidfunk/mkdocs-material/blob/e2136532f40aed98af1f6497c0cc6a3cff9f759b/src/plugins/projects/plugin.py#L271-L293","documentation":"After parsing a project:// URL, the plugin matches the slug against the known projects collected during the build. If no project's reference matches the requested slug, target remains None and the plugin raises PluginError stating the project could not be found. This means the referenced name does not correspond to any project registered in the projects plugin configuration.","triggerScenarios":"_replace resolves a project://slug link where slug matches neither a project directory name/reference nor the slug derived from project hosts configured in the projects plugin config.","commonSituations":"Typo in the project name inside a project:// link; referencing a project that is not listed under the projects plugin's config; renaming a project directory without updating cross-project links; links copied from another docs site.","solutions":["Check the exact slug in the link against the projects declared in the projects plugin config and fix the spelling","Add the missing project to the projects plugin configuration if it should be part of the build","Use the project directory/reference name (as listed in config) rather than an arbitrary hostname"],"exampleFix":"// before\n[API docs](project://api-doc\n// after\n[API docs](project://api-docs)","handlingStrategy":"validation","validationCode":"import os, yaml\ncfg = yaml.safe_load(open(\"mkdocs.yml\"))\nprojects = [p for p in (cfg.get(\"plugins\", {}).get(\"projects\", {}) or {}).get(\"projects\", [])]\nslug = \"api-docs\"\nassert slug in projects or os.path.isdir(slug), f\"Unknown project '{slug}'\"","typeGuard":null,"tryCatchPattern":"try:\n    mkdocs build\nexcept SystemExit:\n    # cross-check the slug in the message against projects config\n    pass","preventionTips":["Keep a canonical list of project slugs and lint project:// links against it","Rename projects atomically: update directory and all cross-links in one commit","Grep the repo for 'project://' regularly to catch stale references"],"tags":["projects-plugin","mkdocs","not-found","url-resolution"],"backgroundTag":"resource-not-found","analyzedSha":"e2136532f40aed98af1f6497c0cc6a3cff9f759b","analyzedAt":"2026-08-29T11:20:04.299Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}