Errors
What a refused call means and what to check.
When a widget cannot load or a call is refused, the visitor sees a short message such as "This widget is not available." The cause goes to the page in two other ways:
- A warning in the browser console: [sWidget <id>] <code> (HTTP <status>): <what to check>.
- The swidget:error event with detail { code, status, widget, retry_after }.
[sWidget k2m9x7q4ab1c] origin_not_allowed (HTTP 403): This page's origin is not one of the widget's allowed websites …
sWidget.on('error', ({ code, status, widget, retry_after }) => { /* … */ });
| Code | HTTP | What to check |
|---|---|---|
origin_not_allowed | 403 | The page's origin is not one of the widget's websites. Compare scheme, host and port exactly (www or not, http or https, the port) and add the origin on the widget's page in the back office. |
invalid_app_key | 401 | The key is not valid: the widget was revoked, got a new key, or the sWidget app was stopped. Copy the snippet again. |
invalid_client | 404 | data-client does not name the widget's client, or the sWidget app is switched off for the client in My Apps. |
widget_call_not_allowed | 403 | The call is not one this widget type makes. Check that data-swidget and data-key belong to the same widget. |
capability_disabled | 403 | A capability the widget needs is switched off for the sWidget app in My Apps: tracking, public quotes or guest shipping. |
app_context_not_found | 404 | The client does not offer this through the sWidget app, for example guest shipping not set up. |
widget_not_found | 404 | The widget id is unknown or belongs to another client. In the back office: the person may not open this staff widget. |
widget_not_enabled_for_app | 403 | The widget's Apps channel does not list the calling app. Tick the app on the widget's page in the back office. |
widget_revoked | 410 | The widget was revoked. Activate it again on its page in the back office. |
widget_unsupported | — | The widget needs a newer sWidget version (a higher config_version or an unknown type). Update the package. |
preview_read_only | 403 | A designer preview refused a write. The widget shows a sample answer marked Preview; nothing was created. |
session_expired | 401 / 419 | Back office only: the session ended or the page's CSRF token is out of date. Sign in again and reload the page. |
too_many_requests | 429 | More than 600 calls a minute for the widget, or 120 for one visitor, or a call's own limit. Retry-After says how many seconds to wait. |
network_error | — | Superroute could not be reached: the network, data-api, a content blocker, or connect-src in the page's Content-Security-Policy. |
When a widget shows "not available"
- Open the browser console and read the [sWidget] warning.
- Compare the page's address with the widget's allowed websites.
- Compare the snippet on the page with the one on the widget's page in the back office (key and client code).
- Check on the widget's page in the back office that the widget is active and that nothing is listed as missing.