{"record":{"id":"d756d27149309e90","repo":"stablyai/orca","slug":"defaultanimation-manifest-defaultanimation-no","errorCode":null,"errorMessage":"defaultAnimation \"${manifest.defaultAnimation}\" not in animations.","messagePattern":"defaultAnimation \"(.+?)\" not in animations\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/pet.ts","lineNumber":364,"sourceCode":"      const rows = dims.height / fh\n      if (manifest.animations) {\n        for (const [name, anim] of Object.entries(manifest.animations)) {\n          if (anim.row >= rows) {\n            throw new Error(`Animation \"${name}\" references row ${anim.row} but sheet has ${rows}.`)\n          }\n          if (anim.frames > columns) {\n            throw new Error(\n              `Animation \"${name}\" has ${anim.frames} frames but sheet only has ${columns} columns.`\n            )\n          }\n          if (anim.frameDurationsMs && anim.frameDurationsMs.length !== anim.frames) {\n            throw new Error(\n              `Animation \"${name}\" declares ${anim.frameDurationsMs.length} frame durations but ${anim.frames} frames.`\n            )\n          }\n        }\n        if (manifest.defaultAnimation && !manifest.animations[manifest.defaultAnimation]) {\n          throw new Error(`defaultAnimation \"${manifest.defaultAnimation}\" not in animations.`)\n        }\n      }\n      sprite = {\n        frameWidth: fw,\n        frameHeight: fh,\n        columns,\n        rows,\n        sheetWidth: dims.width,\n        sheetHeight: dims.height,\n        fps: manifest.fps ?? 8,\n        defaultAnimation: manifest.defaultAnimation,\n        animations: manifest.animations\n      }\n    }\n\n    // Why: always a fresh UUID (not the manifest's display-hint id) to avoid collisions, unsafe ids, and re-import clobbering.\n    const id = randomUUID()\n    const root = getPetsDir()","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/pet.ts#L346-L382","documentation":"Thrown at pet.ts:363-364 when manifest.defaultAnimation is set but its value is not a key in manifest.animations. The playback engine needs to resolve the default animation name to an entry, so a dangling reference would cause a runtime lookup failure. Runs only when manifest.animations is present (inside the block opened at line 347).","triggerScenarios":"pet.json sets defaultAnimation: 'walk' but animations only contains { idle: {...}, run: {...} }. Typo in the default name, or the referenced animation was renamed/removed.","commonSituations":"Author renamed an animation but forgot to update defaultAnimation; copy-paste error; trailing whitespace in the default name.","solutions":["Set defaultAnimation to a key that exists in the animations object.","Or remove defaultAnimation if no default is needed.","Re-export the bundle after fixing pet.json."],"exampleFix":"// before\n{ \"defaultAnimation\": \"walk\", \"animations\": { \"idle\": {...}, \"run\": {...} } }\n// after\n{ \"defaultAnimation\": \"idle\", \"animations\": { \"idle\": {...}, \"run\": {...} } }","handlingStrategy":"validation","validationCode":"function validateDefaultAnimation(defaultAnim: string | undefined, animations: Record<string, unknown> | undefined) {\n  if (defaultAnim && !(defaultAnim in (animations ?? {}))) {\n    throw new Error(`defaultAnimation ${defaultAnim} not in animations`)\n  }\n}","typeGuard":null,"tryCatchPattern":"try { await importPetBundle(p) }\ncatch (e) { if (e instanceof Error && e.message.startsWith('defaultAnimation') && e.message.endsWith('not in animations.')) { /* fix the default name */ } else throw e }","preventionTips":["When renaming an animation, update defaultAnimation in the same edit.","Omit defaultAnimation if you do not need a specific default."],"tags":["pet-bundle","animation","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}