{"record":{"id":"32559fc9414021a4","repo":"phacility/phabricator","slug":"no-resource-source-exists-with-name-s","errorCode":null,"errorMessage":"No resource source exists with name \"%s\"!","messagePattern":"No resource source exists with name \"(.+?)\"!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/celerity/CelerityResourceMap.php","lineNumber":45,"sourceCode":"    $this->packageMap = idx($map, 'packages', array());\n    $this->nameMap = idx($map, 'names', array());\n\n    // We derive these reverse maps at runtime.\n\n    $this->hashMap = array_flip($this->nameMap);\n    $this->componentMap = array();\n    foreach ($this->packageMap as $package_name => $symbols) {\n      foreach ($symbols as $symbol) {\n        $this->componentMap[$symbol] = $package_name;\n      }\n    }\n  }\n\n  public static function getNamedInstance($name) {\n    if (empty(self::$instances[$name])) {\n      $resources_list = CelerityPhysicalResources::getAll();\n      if (empty($resources_list[$name])) {\n        throw new Exception(\n          pht(\n            'No resource source exists with name \"%s\"!',\n            $name));\n      }\n\n      $instance = new CelerityResourceMap($resources_list[$name]);\n      self::$instances[$name] = $instance;\n    }\n\n    return self::$instances[$name];\n  }\n\n  public function getNameMap() {\n    return $this->nameMap;\n  }\n\n  public function getSymbolMap() {\n    return $this->symbolMap;","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/celerity/CelerityResourceMap.php#L27-L63","documentation":"CelerityResourceMap::getNamedInstance($name) only accepts names registered by CelerityPhysicalResources::getAll() (i.e. real resource sources like the Phabricator and Phriction maps). Requesting any other name throws, because no physical resources directory exists to build a map from.","triggerScenarios":"Calling CelerityResourceMap::getNamedInstance('my-resources') without having registered a CelerityPhysicalResources subclass named 'my-resources'; A config value or call site referencing a resource source name that was renamed or never existed (typo: 'phabricato'); Fork code that removed a resources source while a lookup remains","commonSituations":"Building a custom/static distribution with an extra resource package; upgrading Phabricator versions where a map name changed; hardcoded names in dev scripts drifting from the actual class names.","solutions":["Use a name returned by array_keys(CelerityPhysicalResources::getAll())","If you intended a custom source, implement the CelerityPhysicalResources subclass (with the matching getName()) so getAll() registers it","Fix the typo or pass the name dynamically from getAll() instead of a hardcoded string"],"exampleFix":"// before\n$map = CelerityResourceMap::getNamedInstance('my-resource');\n\n// after\n$sources = array_keys(CelerityPhysicalResources::getAll());\n$map = CelerityResourceMap::getNamedInstance($sources[0]); // e.g. 'phabricator'","handlingStrategy":"validation","validationCode":"$known = array_keys(CelerityPhysicalResources::getAll());\nif (!in_array($name, $known, true)) {\n  throw new Exception(\n    'Unknown celerity resource source: '.$name.'. Known: '.implode(', ', $known));\n}\n$map = CelerityResourceMap::getNamedInstance($name);","typeGuard":null,"tryCatchPattern":"try {\n  $map = CelerityResourceMap::getNamedInstance($name);\n} catch (Exception $ex) {\n  // Fall back to the default distribution map.\n  $map = CelerityResourceMap::getNamedInstance('phabricator');\n}","preventionTips":["Derive map names from CelerityPhysicalResources::getAll(), never hardcode strings","Name your custom CelerityPhysicalResources subclass to match the lookup key exactly","Re-check registered names after upgrades — sources can be added, renamed, or dropped"],"tags":["phabricator","celerity","asset-pipeline","resources"],"backgroundTag":"unknown-resource-name","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}