{"record":{"id":"14625bd1ab9e991f","repo":"phacility/phabricator","slug":"attempting-to-resolve-unknown-resource-s","errorCode":null,"errorMessage":"Attempting to resolve unknown resource, \"%s\".","messagePattern":"Attempting to resolve unknown resource, \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/celerity/CelerityResourceMap.php","lineNumber":93,"sourceCode":"    $resolved = $this->resolveResources($symbols);\n    return $this->packageResources($resolved);\n  }\n\n  private function resolveResources(array $symbols) {\n    $map = array();\n    foreach ($symbols as $symbol) {\n      if (!empty($map[$symbol])) {\n        continue;\n      }\n      $this->resolveResource($map, $symbol);\n    }\n\n    return $map;\n  }\n\n  private function resolveResource(array &$map, $symbol) {\n    if (empty($this->symbolMap[$symbol])) {\n      throw new Exception(\n        pht(\n          'Attempting to resolve unknown resource, \"%s\".',\n          $symbol));\n    }\n\n    $hash = $this->symbolMap[$symbol];\n\n    $map[$symbol] = $hash;\n\n    if (isset($this->requiresMap[$hash])) {\n      $requires = $this->requiresMap[$hash];\n    } else {\n      $requires = array();\n    }\n\n    foreach ($requires as $required_symbol) {\n      if (!empty($map[$required_symbol])) {\n        continue;","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/celerity/CelerityResourceMap.php#L75-L111","documentation":"When Celerity needs the hash for a JS/CSS symbol, resolveResource() looks it up in the symbol map built from each resource's @celerity-provides annotation. An unknown symbol means no resource in any known map declares that name — it was removed, renamed, never provided, or the requesting code has a typo.","triggerScenarios":"Calling requireResource('phabricator-thing-that-no-longer-exists') or CelerityResourceMap methods for a symbol nobody annotates with '@celerity-provides phabricator-thing'; A resource file was renamed/deleted but callers still request its symbol; A newly added JS file lacks the javelin @provides directive so it never enters the map","commonSituations":"Refactors that rename a JS/CSS module without updating all requireResource()/@requires references; deploying code where a node has an older resource map; typos in symbol names inside PHP templates.","solutions":["Check the resource file for the matching '@celerity-provides <symbol>' javelin directive and add it if missing","Fix or update the symbol name at the call site to match the current @celerity-provides value","After adding new resources, restart daemons/web fronts (or clear the celerity map cache) so the map is rebuilt"],"exampleFix":"// before (resource file has no annotation)\n// src/webroot/rsrc/js/my-thing.js contents: JX.behavior('my-thing', ...)\n\n// after\n/**\n * @provides my-thing\n */\nJX.behavior('my-thing', ...);","handlingStrategy":"try-catch","validationCode":"// Celerity exposes the package/symbol map; verify before requiring:\n$map = CelerityResourceMap::getNamedInstance('phabricator');\n$symbols = array_keys($map->getSymbolMap());\nif (!in_array($symbol, $symbols, true)) {\n  phlog('Unknown celerity symbol: '.$symbol);\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  require_celerity_resources(array($symbol));\n} catch (Exception $ex) {\n  phlog('Celerity symbol missing (stale map?): '.$symbol);\n  // Skip gracefully in dev; fail loudly in production.\n  if (!PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) {\n    throw $ex;\n  }\n}","preventionTips":["Every resource file must declare '@celerity-provides <symbol>'; make this a lint/review check","When renaming a resource, grep for its old symbol in PHP call sites before landing","Restart daemons and web frontends after resource changes so the symbol map is rebuilt"],"tags":["phabricator","celerity","asset-pipeline","javascript","css"],"backgroundTag":"unknown-asset-symbol","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}