moeru-ai/airi · error

VRM model loading failure!

Error message

VRM model loading failure!

What it means

loadVrm resolved but the payload was unusable (_vrm or _vrmGroup missing) — typically a plain glTF/glb without the VRM extension, or a truncated/corrupt file. If the request is still current, emitVrmLoadError records the failure and the component emits an error event with 'VRM model loading failure'; if a newer load request superseded it (isLoadRequestCurrent false), the failure is dropped silently.

Source

Thrown at packages/stage-ui-three/src/components/Model/VRMModel.vue:741

            sceneSummary: createVrmSceneSummarySnapshot({ mixer: reusableInstance.mixer, vrm: reusableInstance.vrm }),
            ts: performance.now(),
          })
        }
        return
      }
    }

    const _vrmInfo = await loadVrm(modelSrc.value, {
      lookAt: true,
      onProgress: progress => emit(
        'loadingProgress',
        Number((100 * progress.loaded / progress.total).toFixed(2)),
      ),
    })
    if (!_vrmInfo || !_vrmInfo._vrm || !_vrmInfo._vrmGroup) {
      if (isLoadRequestCurrent(requestId)) {
        emitVrmLoadError(currentLoadReason, loadStartedAt, 'VRM model loading failure')
        console.warn('VRM model loading failure!')
        emit('error', new Error('VRM model loading failure'))
      }
      return
    }
    const {
      _vrm,
      _vrmGroup,
    } = _vrmInfo
    nextVrm = _vrm
    nextVrmGroup = _vrmGroup

    if (!isLoadRequestCurrent(requestId)) {
      disposeDetachedVrm(nextVrm, nextVrmGroup)
      return
    }

    runVrmLoadHooks({
      cacheHit: false,

View on GitHub (pinned to 677329427f)

Solutions

  1. Confirm the file is a real VRM: plain glb/gltf files parse but resolve without _vrm
  2. Re-download or re-export the model; truncated files commonly parse yet miss the VRM extension
  3. Update the three-vrm runtime if the model uses a newer VRM spec
  4. Handle the emitted error event in the UI with an actionable import message
  5. Check the network response MIME and headers when loading from a remote URL

Example fix

// before
const _vrmInfo = await loadVrm(modelSrc.value, { lookAt: true, onProgress })
if (!_vrmInfo || !_vrmInfo._vrm || !_vrmInfo._vrmGroup) {
  emitVrmLoadError(currentLoadReason, loadStartedAt, 'VRM model loading failure')
}

// after: reject non-VRM gltf up front with a precise reason
if (!/\.vrm$/i.test(modelSrc.value)) {
  if (isLoadRequestCurrent(requestId))
    emitVrmLoadError(currentLoadReason, loadStartedAt, 'File is not a VRM model')
  return
}
Defensive patterns

Strategy: validation

Validate before calling

if (!/\.vrm$/i.test(modelSrc.value)) {
  emit('error', new Error('File is not a VRM model'))
  return
}

Type guard

interface VrmLoadResult { _vrm: unknown, _vrmGroup: unknown }

function isVrmLoadResult(info: unknown): info is VrmLoadResult {
  return !!info && typeof info === 'object' && '_vrm' in info && '_vrmGroup' in info
    && (info as VrmLoadResult)._vrm != null && (info as VrmLoadResult)._vrmGroup != null
}

Try / catch

const _vrmInfo = await loadVrm(modelSrc.value, { lookAt: true, onProgress })
if (!isVrmLoadResult(_vrmInfo)) {
  if (isLoadRequestCurrent(requestId)) {
    emitVrmLoadError(currentLoadReason, loadStartedAt, 'VRM model loading failure')
    emit('error', new Error('VRM model loading failure'))
  }
  return
}

Prevention

When it happens

Trigger: Importing a plain .glb renamed to .vrm (no VRM extension in the glTF JSON); truncated or corrupt download; VRM version newer than the three-vrm runtime supports; wrong MIME from the hosting server.

Common situations: Users importing arbitrary glb files as avatars; interrupted downloads; models exported by newer VRoid/UniVRM versions.

Related errors


AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18). Data as JSON: /api/errors/18196f69045e4882. Report an issue: GitHub.