[Sofia SDK] when debug="true" is enabled.
For symptom-based troubleshooting (e.g., “component doesn’t load”), see the Troubleshooting guide.
Error categories
The SDK classifies errors into seven categories, each with a dedicated logger method:| Category | Prefix | Trigger |
|---|---|---|
config | [Sofia SDK] Configuration Error | Missing or invalid props, component won’t mount |
auth | [Sofia SDK] Authentication Error | Invalid API key, expired token (HTTP 401) |
api | [Sofia SDK] API Error | Network failures, server errors, report generation failures |
settings | [Sofia SDK] Settings Error | Template parsing failures, settings fetch errors |
audio | [Sofia SDK] Audio Error | Microphone access denied, audio recording failures |
storage | [Sofia SDK] Storage Error | LocalStorage unavailable, encryption failures |
webSocket | [Sofia SDK] WebSocket Error | Connection failures, disconnections during transcription |
Configuration errors
Missing required properties
Console output:baseurl, wssurl, apikey) is missing or empty.
Resolution:
- Verify all three props are set on the
<sofia-sdk>element - Check that values are not empty strings or
undefined - Ensure URLs use the correct protocol (
https://for baseurl,wss://for wssurl)
Missing session identifiers
Console output:userid or patientid is missing or empty.
Resolution:
- Provide both
useridandpatientidas non-empty strings - These values should uniquely identify the current doctor and patient session
Authentication errors
Invalid API key (HTTP 401)
Console output:apikey prop contains an invalid, expired, or revoked API key.
Resolution:
- Verify the API key is correct and active
- Confirm you’re using the right key for your environment (sandbox vs production)
- Check that the key hasn’t been rotated or revoked
- Contact support if the key should be valid
Incorrect base URL (HTTP 404)
Console output:baseurl prop points to a non-existent endpoint.
Resolution:
- Verify the URL matches your assigned environment
- Ensure you’re not mixing sandbox and production URLs
- Check for typos in the URL
Settings errors
Template validation failed
Console output:template prop contains invalid JSON or is missing required schema keys ($schema, type, properties).
Resolution:
- Validate your JSON syntax at jsonlint.com
- Ensure the schema includes
"$schema": "http://json-schema.org/draft-07/schema#" - Verify
"type": "object"is present - Check that
propertiescontains at least one field definition - See Template validation checklist for details
Fallback to server template
Console output:template prop couldn’t be parsed after three attempts (JSON.parse, prefix removal, Function eval). The SDK falls back to the server-configured template for your templateid.
Resolution:
- Fix the local template JSON — this is usually a syntax error
- Check for unescaped special characters in the template string
- If passing programmatically, ensure you’re passing a JSON string, not a JavaScript object
API errors
Report generation failed
Console output:- Check the specific error message for details
- Verify network connectivity to the API server
- Ensure the template schema is valid
- If the error persists, retry after a few seconds
- Contact support with the error message if the issue continues
Network errors
Console output:- Verify internet connectivity
- Check if the API endpoint is reachable
- Look for CORS errors in the browser console
- Verify firewall/proxy settings don’t block the API domain
Audio errors
Microphone access denied
Console output:- Check browser permissions — click the lock icon in the address bar
- Ensure the page is served over HTTPS (required for WebRTC)
- Verify the microphone hardware is connected and functional
- In Chrome, go to
chrome://settings/content/microphoneto check site permissions
Audio recording failure
Console output:- Try a different microphone
- Close other applications that may be using the microphone
- Test in a different browser (Chrome is recommended)
- Check the browser console for more specific WebRTC errors
WebSocket errors
Connection failure
Console output:- Verify
wssurluses thewss://protocol - Check network connectivity and firewall rules
- Ensure WebSocket connections are not blocked by proxy
- Verify the WebSocket endpoint is correct for your environment
Disconnection during transcription
Console output:- Check network stability
- The SDK attempts automatic reconnection — wait for it to reconnect
- If disconnections are frequent, check your network infrastructure
- Verify no proxy or firewall is terminating idle WebSocket connections
Storage errors
LocalStorage unavailable
Console output:- Check if the browser is in private/incognito mode — some features may not persist
- Clear browser storage if it’s full
- Verify that LocalStorage is not blocked by enterprise policies or browser settings
Input validation errors
These errors occur when user input fails security validation:| Error message | Cause |
|---|---|
Input exceeds maximum length of {n} characters | Input text is too long |
Input contains only whitespace | Empty or whitespace-only input |
URLs not allowed in input | Input contains URLs (blocked by default) |
Potentially malicious HTML/JavaScript content detected | XSS patterns detected |
Potentially malicious SQL content detected | SQL injection patterns detected |
Potentially malicious NoSQL content detected | NoSQL injection patterns detected |
Invalid JSON format | Malformed JSON in a JSON-expected field |
Input validation runs automatically on user input. These errors are security features and should not be suppressed. If legitimate medical text triggers a false positive, contact support with the specific text that was rejected.
Deprecation warnings
When using deprecated props withdebug="true", the SDK emits: