Patient portal errors
How MedosPatientPortal reports failures — config mistakes that throw, start-up failures that reach onError, and in-flow errors it handles itself.
Failures split the same three ways as the booking widget, and only one reaches
onError.
| What went wrong | How you see it | Example |
|---|---|---|
| Bad config | init() throws synchronously | "API key is required" |
| Portal can't start | onError(error) | Workspace lookup rejected the key |
| Something failed mid-flow | The portal's own inline error UI | A wrong verification code |
Config mistakes throw
| Thrown message | Cause |
|---|---|
API key is required | No apiKey passed. |
containerId is required for inline mode | Inline mode without a container. |
Container with id "X" not found | Inline mode, missing DOM node. |
try {
MedosPatientPortal.init({
apiKey: "mk_...",
mode: "inline",
containerId: "medos-portal",
});
} catch (err) {
console.error("Medos portal failed to start:", err);
}A script that fails to load is not an error init() can catch
If the script tag itself fails to load — a Content Security Policy that doesn't
allow widgets.medos.one, an ad blocker, a network error — then
window.MedosPatientPortal is never defined and calling init() throws a
TypeError on undefined. Check the Network tab before debugging your config.
Nothing is visible before verification
No patient data is fetched until a code has been confirmed, so a portal that renders the contact field and nothing else has not failed — it is waiting.
For problems that apply to every widget — a key that works on one domain but not another, a theme or font that doesn't apply — see Troubleshooting.