{"record":{"id":"cf45c146c950599a","repo":"SillyTavern/SillyTavern","slug":"edge-tts-module-not-loaded-add-edge-tts-to-enable","errorCode":null,"errorMessage":"Edge TTS module not loaded. Add edge-tts to enable-modules and restart the Extras API.","messagePattern":"Edge TTS module not loaded\\. Add edge-tts to enable-modules and restart the Extras API\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"public/scripts/extensions/tts/edge.js","lineNumber":248,"sourceCode":"    getVoicesUrl() {\n        if (this.settings.provider === EDGE_TTS_PROVIDER.extras) {\n            const url = new URL(getApiUrl());\n            url.pathname = '/api/edge-tts/list';\n            return url.toString();\n        }\n\n        if (this.settings.provider === EDGE_TTS_PROVIDER.plugin) {\n            return '/api/plugins/edge-tts/list';\n        }\n\n        throw new Error('Invalid TTS Provider');\n    }\n\n    async throwIfModuleMissing() {\n        if (this.settings.provider === EDGE_TTS_PROVIDER.extras && !modules.includes('edge-tts')) {\n            const message = 'Edge TTS module not loaded. Add edge-tts to enable-modules and restart the Extras API.';\n            // toastr.error(message)\n            throw new Error(message);\n        }\n\n        if (this.settings.provider === EDGE_TTS_PROVIDER.plugin && !this.isPluginAvailable()) {\n            const message = 'Edge TTS Server plugin not loaded. Install it from https://github.com/SillyTavern/SillyTavern-EdgeTTS-Plugin and restart the SillyTavern server.';\n            // toastr.error(message)\n            throw new Error(message);\n        }\n    }\n\n    async isPluginAvailable() {\n        try {\n            const result = await fetch('/api/plugins/edge-tts/probe', {\n                method: 'POST',\n                headers: getRequestHeaders({ omitContentType: true }),\n            });\n            return result.ok;\n        } catch (e) {\n            return false;","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/SillyTavern/SillyTavern/blob/8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8/public/scripts/extensions/tts/edge.js#L230-L266","documentation":"Thrown by EdgeTtsProvider.throwIfModuleMissing when the extras provider is selected but 'edge-tts' is not present in the loaded modules list (the modules array imported from the SillyTavern extras discovery). It signals the Extras backend is reachable but the edge-tts capability was not enabled.","triggerScenarios":"Selecting the extras provider while config.yaml enable-modules omits 'edge-tts', or the Extras server was started without that module installed. throwIfModuleMissing runs before generation/voice listing.","commonSituations":"Fresh Extras install missing the edge-tts python package; enable-modules edited but server not restarted; modules list not yet fetched when the check runs.","solutions":["Add 'edge-tts' to enable-modules in the SillyTavern config and restart the server.","Install/upgrade the edge-tts package in the Extras environment (pip install edge-tts).","Confirm the Extras API URL is correct so the modules array actually reflects the running backend."],"exampleFix":"// before\nasync throwIfModuleMissing() {\n    if (this.settings.provider === EDGE_TTS_PROVIDER.extras && !modules.includes('edge-tts')) {\n        const message = 'Edge TTS module not loaded. Add edge-tts to enable-modules and restart the Extras API.';\n        throw new Error(message);\n    }\n}\n\n// after - surface current modules for debugging\nasync throwIfModuleMissing() {\n    if (this.settings.provider === EDGE_TTS_PROVIDER.extras && !modules.includes('edge-tts')) {\n        throw new Error(\n            `Edge TTS module not loaded (available: ${modules.join(', ') || 'none'}). ` +\n            `Add edge-tts to enable-modules and restart the Extras API.`,\n        );\n    }\n}","handlingStrategy":"validation","validationCode":"function assertExtrasModuleAvailable() {\n  if (provider.settings.provider === 'extras' && !modules.includes('edge-tts')) {\n    throw new Error('Enable edge-tts in Extras enable-modules and restart the Extras API.');\n  }\n}\n// call before generation/voice listing\nassertExtrasModuleAvailable();","typeGuard":"function extrasHasEdgeTts() {\n  return Array.isArray(modules) && modules.includes('edge-tts');\n}","tryCatchPattern":"try {\n  await provider.throwIfModuleMissing();\n} catch (e) {\n  if (/Edge TTS module not loaded/.test(e.message)) {\n    toastr.info('Enable edge-tts in Extras and restart, or switch to the plugin provider.');\n    return; // abort generation gracefully\n  }\n  throw e;\n}","preventionTips":["Run throwIfModuleMissing before listing voices or generating.","Keep enable-modules in config.yaml in sync with installed Extras packages.","Restart the Extras API after changing enable-modules.","Surface the available modules list in the error for faster diagnosis."],"tags":["tts","edge-tts","extras","module-dependency"],"backgroundTag":null,"analyzedSha":"8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8","analyzedAt":"2026-08-13T07:48:40.832Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}