phacility/phabricator · error · Exception
Attempting to resolve unknown resource, "%s".
Error message
Attempting to resolve unknown resource, "%s".
What it means
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.
Source
Thrown at src/applications/celerity/CelerityResourceMap.php:93
$resolved = $this->resolveResources($symbols);
return $this->packageResources($resolved);
}
private function resolveResources(array $symbols) {
$map = array();
foreach ($symbols as $symbol) {
if (!empty($map[$symbol])) {
continue;
}
$this->resolveResource($map, $symbol);
}
return $map;
}
private function resolveResource(array &$map, $symbol) {
if (empty($this->symbolMap[$symbol])) {
throw new Exception(
pht(
'Attempting to resolve unknown resource, "%s".',
$symbol));
}
$hash = $this->symbolMap[$symbol];
$map[$symbol] = $hash;
if (isset($this->requiresMap[$hash])) {
$requires = $this->requiresMap[$hash];
} else {
$requires = array();
}
foreach ($requires as $required_symbol) {
if (!empty($map[$required_symbol])) {
continue;View on GitHub (pinned to 5720a38cfe)
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
Example fix
// before (resource file has no annotation)
// src/webroot/rsrc/js/my-thing.js contents: JX.behavior('my-thing', ...)
// after
/**
* @provides my-thing
*/
JX.behavior('my-thing', ...); Defensive patterns
Strategy: try-catch
Validate before calling
// Celerity exposes the package/symbol map; verify before requiring:
$map = CelerityResourceMap::getNamedInstance('phabricator');
$symbols = array_keys($map->getSymbolMap());
if (!in_array($symbol, $symbols, true)) {
phlog('Unknown celerity symbol: '.$symbol);
return;
} Try / catch
try {
require_celerity_resources(array($symbol));
} catch (Exception $ex) {
phlog('Celerity symbol missing (stale map?): '.$symbol);
// Skip gracefully in dev; fail loudly in production.
if (!PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) {
throw $ex;
}
} Prevention
- 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
When it happens
Trigger: 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
Common situations: 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.
Related errors
- No resource source exists with name "%s"!
- Only static resources may be served.
- Request parameter "%s" is not formatted properly. Expected a
- Request parameter "%s" is not formatted properly. Expected a
- Invalid Request (CSRF)
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/14625bd1ab9e991f.
Report an issue: GitHub.