{"record":{"id":"834f7be6552f7ea8","repo":"SillyTavern/SillyTavern","slug":"coqui-tts-module","errorCode":null,"errorMessage":"<Coqui TTS module> ","messagePattern":"<Coqui TTS module> ","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"public/scripts/extensions/tts/coqui.js","lineNumber":47,"sourceCode":"        \"kokoro\": {\n            \"tacotron2-DDC\": \"tts_models/ja/kokoro/tacotron2-DDC\"\n        }\n    }\n}\n*/\nconst languageLabels = {\n    'multilingual': 'Multilingual',\n    'en': 'English',\n    'fr': 'French',\n    'es': 'Spanish',\n    'ja': 'Japanese',\n};\n\nfunction throwIfModuleMissing() {\n    if (!modules.includes('coqui-tts')) {\n        const message = 'Coqui TTS module not loaded. Add coqui-tts to enable-modules and restart the Extras API.';\n        // toastr.error(message, { timeOut: 10000, extendedTimeOut: 20000, preventDuplicates: true });\n        throw new Error(DEBUG_PREFIX, message);\n    }\n}\n\nfunction resetModelSettings() {\n    $('#coqui_api_model_settings_language').val('none');\n    $('#coqui_api_model_settings_speaker').val('none');\n}\n\nclass CoquiTtsProvider {\n    //#############################//\n    //  Extension UI and Settings  //\n    //#############################//\n\n    settings;\n\n    defaultSettings = {\n        voiceMap: {},\n        customVoices: {},","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/SillyTavern/SillyTavern/blob/8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8/public/scripts/extensions/tts/coqui.js#L29-L65","documentation":"BUG: throwIfModuleMissing calls `throw new Error(DEBUG_PREFIX, message)`. The standard Error constructor takes a single message string; the second argument (the helpful explanation) is silently ignored. So the thrown error's message is just DEBUG_PREFIX ('<Coqui TTS module> ') and the actionable text ('Add coqui-tts to enable-modules...') is lost. The underlying condition is that the Extras API was started without the coqui-tts module enabled.","triggerScenarios":"Calling any CoquiTtsProvider method (install, generate, list, etc.) when the SillyTavern Extras server was launched without `--enable-modules=...coqui-tts...` so the global `modules` array does not include 'coqui-tts'.","commonSituations":"User installed/runs the Extras API without coqui-tts; switched Extras instances to one lacking coqui-tts; module name misspelled in the enable-modules flag.","solutions":["Fix the bug: pass a single message — `throw new Error(DEBUG_PREFIX + message)` or `throw new Error(message)` — so users see the real instructions.","On the ops side: restart the Extras API with coqui-tts in --enable-modules (e.g. --enable-modules=caption,chaterbox,coqui-tts).","Confirm the connected Extras URL is the one that has coqui-tts enabled (not a different instance)."],"exampleFix":"// before\nthrow new Error(DEBUG_PREFIX, message);\n// after\nthrow new Error(DEBUG_PREFIX + message);","handlingStrategy":"validation","validationCode":"// ensure module enabled before any Coqui call\nif (!modules.includes('coqui-tts')) {\n    toastr.error('Enable the coqui-tts module in Extras and restart.', 'Coqui TTS');\n    return;\n}","typeGuard":"/** @param {string[]} mods */\nconst coquiEnabled = (mods) => Array.isArray(mods) && mods.includes('coqui-tts');","tryCatchPattern":"try {\n    CoquiTtsProvider.installModel(model_id, action);\n} catch (err) {\n    // NOTE: current message is just DEBUG_PREFIX due to the two-arg Error() bug — fix the throw first\n    console.error('Coqui module error:', err);\n}","preventionTips":["Fix the throw: `throw new Error(DEBUG_PREFIX + message)` so the real text surfaces.","Start Extras with coqui-tts in --enable-modules.","Confirm the connected Extras instance is the one with coqui-tts."],"tags":["tts","coqui","bug","extras","config","error-message"],"backgroundTag":null,"analyzedSha":"8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8","analyzedAt":"2026-08-13T07:48:40.832Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}