{"record":{"id":"4446ab151fcd9cb3","repo":"moeru-ai/airi","slug":"no-vrm-found","errorCode":null,"errorMessage":"No VRM found","messagePattern":"No VRM found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/stage-ui-three/src/composables/vrm/animation.ts","lineNumber":39,"sourceCode":"  // load VRM Animation .vrma file\n  const gltf = await loader.loadAsync(url)\n\n  const userData = gltf.userData as GLTFUserdata\n  if (!userData.vrmAnimations) {\n    console.warn('No VRM animations found in the .vrma file')\n    return\n  }\n  if (userData.vrmAnimations.length === 0) {\n    console.warn('No VRM animations found in the .vrma file')\n    return\n  }\n\n  return userData.vrmAnimations[0]\n}\n\nexport async function clipFromVRMAnimation(vrm?: VRMCore, animation?: VRMAnimation) {\n  if (!vrm) {\n    console.warn('No VRM found')\n    return\n  }\n  if (!animation) {\n    return\n  }\n\n  // create animation clip\n  return createVRMAnimationClip(animation, vrm)\n}\n\n// Set initial positions for animation\nexport function reAnchorRootPositionTrack(clip: AnimationClip, _vrm: VRMCore) {\n// Get the hips node to re-anchor the root position track\n  const hipNode = _vrm.humanoid?.getNormalizedBoneNode('hips')\n  if (!hipNode) {\n    console.warn('No hips node found in VRM model.')\n    return\n  }","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/stage-ui-three/src/composables/vrm/animation.ts#L21-L57","documentation":"clipFromVRMAnimation(vrm, animation) takes both parameters optional on purpose, but if vrm is undefined it warns 'No VRM found' and returns undefined — you cannot build an AnimationClip from a VRMAnimation without the target VRM rig. The animation parameter is then never even examined.","triggerScenarios":"Calling clipFromVRMAnimation(undefined, anim) after the VRM model failed to load, is still loading, or the variable was never assigned; wiring animation loading before model loading and not awaiting the model.","commonSituations":"Race between model load and animation load in onMounted; a model-load failure swallowed earlier so undefined propagates; refactoring that renamed the vrm variable.","solutions":["Ensure the VRM is fully loaded (await the VRM loader) before creating the clip.","Check the model-load path for a silently swallowed error upstream.","Guard the call site and skip animation setup when vrm is absent."],"exampleFix":"// before\nconst clip = await clipFromVRMAnimation(vrmRef.current, animation) // vrmRef.current may be undefined\n\n// after\nif (!vrmRef.current) return // model not ready; skip or await model load first\nconst clip = await clipFromVRMAnimation(vrmRef.current, animation)","handlingStrategy":"type-guard","validationCode":"if (!vrm) { /* model not loaded yet: skip or await */ }","typeGuard":"function isLoadedVRM(v: VRMCore | undefined | null): v is VRMCore {\n  return !!v\n}","tryCatchPattern":null,"preventionTips":["Await model load before animation load; order dependencies explicitly.","Do not swallow model-load errors upstream — undefined vrm is usually an earlier failure leaking through.","Make optional-parameter helpers fail loud in dev via assert helpers."],"tags":["vrm","animation","undefined-argument","load-order"],"backgroundTag":"model-not-loaded","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}