{"record":{"id":"14d8f8e25b411a76","repo":"moeru-ai/airi","slug":"failed-to-initialize-transcription-provider-14d8f8","errorCode":null,"errorMessage":"Failed to initialize transcription provider","messagePattern":"Failed to initialize transcription provider","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/stage-pages/src/pages/settings/providers/transcription/mimo-audio-transcription.vue","lineNumber":70,"sourceCode":"    providers.value[providerId].model = value\n  },\n})\n\nconst apiKeyConfigured = computed(() => !!providers.value[providerId]?.apiKey)\n\nconst providerModels = computed(() => providersStore.getModelsForProvider(providerId))\n\nconst isLoadingModels = computed(() => providersStore.isLoadingModels[providerId] || false)\n\nonMounted(async () => {\n  await providersStore.loadModelsForConfiguredProviders()\n  await providersStore.fetchModelsForProvider(providerId)\n})\n\nasync function handleGenerateTranscription(file: File) {\n  const provider = await providersStore.getProviderInstance<TranscriptionProviderWithExtraOptions<string, any>>(providerId)\n  if (!provider)\n    throw new Error('Failed to initialize transcription provider')\n\n  return await hearingStore.transcription(\n    providerId,\n    provider,\n    model.value,\n    file,\n    'json',\n  )\n}\n\nconst {\n  t,\n  router,\n  providerMetadata,\n  isValidating,\n  isValid,\n  validationMessage,\n  handleResetSettings,","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/stage-pages/src/pages/settings/providers/transcription/mimo-audio-transcription.vue#L52-L88","documentation":"Thrown by the MiMo audio transcription playground when `getProviderInstance` resolves falsy before transcription. The page loads models on mount; building the provider needs the persisted MiMo API key. The store's own missing-config/definition paths throw other messages, so this guard fires when the factory returns `undefined` — the runtime shape the non-nullable `Promise<R>` type does not model, classically caused by blank credentials.","triggerScenarios":"Clicking transcribe before saving the MiMo API key; a whitespace/empty key persisted; transcribing before the onMounted model fetch completes while no credentials exist.","commonSituations":"Key entered for MiMo speech but not the transcription entry (separate config slots); clearing and saving the key to troubleshoot; expired keys re-entered without saving; skipping validation with force.","solutions":["Save a valid MiMo API key for the transcription provider entry and let validation pass.","Reload the page after saving so the instance rebuilds.","Inspect console for `Error creating provider instance for ...` for the decline reason.","Verify the selected model comes from the fetched MiMo transcription model list.","Report it if valid credentials still produce a falsy instance."],"exampleFix":"// before\nconst provider = await providersStore.getProviderInstance<TranscriptionProviderWithExtraOptions<string, any>>(providerId)\nif (!provider)\n  throw new Error('Failed to initialize transcription provider')\n\n// after\nconst config = providerStore.getProviderConfig(providerId)\nif (!config?.apiKey?.trim())\n  throw new Error('MiMo API key is empty. Save it in provider settings first.')\nconst provider = await providersStore.getProviderInstance<TranscriptionProviderWithExtraOptions<string, any>>(providerId)\nif (!provider || typeof provider.transcription !== 'function')\n  throw new Error('MiMo factory returned no usable instance — check config and console logs')","handlingStrategy":"validation","validationCode":"const apiKeyConfigured = computed(() => !!providers.value[providerId]?.apiKey?.trim())\nif (!apiKeyConfigured.value)\n  throw new Error('Save a MiMo API key before transcribing')","typeGuard":"function isTranscriptionProvider(v: unknown): v is TranscriptionProviderWithExtraOptions<string, any> {\n  return typeof v === 'object' && v !== null && typeof (v as TranscriptionProviderWithExtraOptions<string, any>).transcription === 'function'\n}","tryCatchPattern":"try { return await hearingStore.transcription(providerId, provider, model.value, file, 'json') }\ncatch (error) { showError(errorMessageFrom(error)) }","preventionTips":["Configure the transcription provider entry separately from the speech one.","Wait for the onMounted model fetch before enabling transcription.","Reload after credential changes."],"tags":["transcription","provider","initialization","api-key","mimo"],"backgroundTag":"provider-instance-undefined","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}