Skip to content

Errors

The widget handles problems in two different ways on purpose. Which one you get depends on whether the chat button is already showing.

The widget only shows the chat button once it has finished starting up. If something goes wrong while it starts, the button never appears at all. Visitors see nothing broken or half-finished. The reason is written to the browser console, a hidden panel in the browser’s developer tools that shows technical messages. You can open it to find out what happened. Troubleshooting shows how to match what you see to a fix.

These are the cases:

  • A connection key that is wrong or unknown. The console shows [whoo-aiden-widget] initialization failed: followed by Failed to create widget session (404). The key may be mistyped, replaced, or turned off.
  • A website address that is not on the allowed list. The same message appears, ending in (403). The response body, visible on the Network tab of the developer tools, says “Origin not allowed for this key”. “Origin” is the technical word for your website’s address. See Connection keys and allowed website addresses.
  • Too many sessions started for the key. The same message appears, ending in (429). A key can only start a limited number of new chat sessions each day, currently 1,000. Until that limit frees up, further page loads get no chat button. From widget version 0.10.8, a visitor who already has a session from an earlier page in the same browser tab keeps the chat button on further pages while more than 5 minutes of that session are left. After that, the next page asks Aiden for a new session, and gets no chat button.
  • The browser could not reach Aiden. In Chrome-based browsers, the console shows initialization failed followed by TypeError: Failed to fetch. Other browsers use their own wording. This happens when the visitor is offline, or when your site’s Content Security Policy blocks the request. A Content Security Policy is a security setting that lists which outside services a page may talk to. See Troubleshooting.
  • A mistake in the init() call. Passing both publishableKey and sessionToken, or neither, stops your own script with an error that says init() requires exactly one of publishableKey or sessionToken, not both or neither. Nothing is shown to visitors.
  • A session token that has expired or that Aiden refuses. The console shows initialization failed followed by The sessionToken has expired., or by Failed to load widget branding (401) (or 403). The widget reads the token’s expiry time itself when it starts, without contacting Aiden. If the time has passed, it asks getSessionToken for a new token if you passed it, and otherwise stops there. It does not check the token’s signature, and it never rejects a token it cannot read, such as one that is not a real token or has no expiry time. Otherwise, when it asks Aiden for your assistant’s name and colors using the token, a refusal has the same effect: a 403 straight away, and a 401 when getSessionToken is missing or returns no token that Aiden accepts. If getSessionToken throws an error or takes longer than 15 seconds there, the chat button appears, and the widget tries again when the visitor sends a message. Any other failure of that request, such as a network problem, is ignored, because the name and colors are only cosmetic. The widget waits at most 3 seconds for that answer. If Aiden is slower, the chat button appears anyway. From widget version 0.9.0, a refusal that arrives later no longer removes it: the chat window shows “This chat session has expired. Reload the page to continue.” instead. If you pass name, color, inkColor and accentColor yourself, the widget does not ask, so only the expiry check applies. A token that Aiden would refuse is then only noticed when the visitor sends their first message, and handled as described below: replaced through getSessionToken for a 401, or shown as an error.

Small cosmetic problems never stop the widget. A color it cannot use, an image address that is not allowed, an invalid zIndex, or a mistake in theme or layout each write a warning in the console, and the widget keeps its default look. See the next section.

A mistake in theme or layout is never an error. init() does not stop, the chat button still appears, and nothing is shown to visitors. The widget writes a warning in the browser console, ignores the part that is wrong, and uses the calculated color or default for it. The rest of your theme and layout still applies.

The warnings start with whoo-aiden-widget: or with [whoo-aiden-widget]. These are the cases, with an example of each message:

  • A key it does not know, such as a misspelled role name. theme.colors.primery is not a role, so it does nothing.
  • A value of the wrong type. For example, theme that is not an object, or a color role that is not a string.
  • A color it cannot use. A typo, currentColor, a var(...) reference or an unsupported format is ignored, and the calculated color is used.
  • A font stack it rejects. One that is over 200 characters, or that contains url(, @, ;, {, } or a backslash.
  • A text size that is out of range or not a positive number. From widget version 0.10.7. A size outside its range is moved to the nearest limit. A value that is not a positive number, such as 0, -4 or '16px', is ignored.
  • A launcher icon name or image address that is not allowed.
  • A layout number that is out of range, or an offset that does not fit the screen.
  • A color override with low contrast. The widget still uses your color. When you override a background, the widget also warns about each default color on it that becomes hard to read, and names the role to override too. See Overriding colors with theme.colors.
  • A translucent theme.colors.primary. The chat button shows your page through it, so its icon can be unreadable over dark content. Pass a solid color.
whoo-aiden-widget: ignoring unknown option `theme.colors.primery`.
whoo-aiden-widget: ignoring `theme` -- expected an object.
whoo-aiden-widget: ignoring `theme.colors.primary` -- expected a CSS color string.
[whoo-aiden-widget] Could not use "blue-ish" as theme.colors.primary; using the calculated color.
[whoo-aiden-widget] theme.colors.focusRing (#111827) has 1.20:1 contrast against the panel color; 3:1 is recommended. Using it as given.
[whoo-aiden-widget] the focusRing color (#111827) has 1.06:1 contrast against your theme.colors.panel; 3:1 is recommended. Override theme.colors.focusRing too.
[whoo-aiden-widget] theme.colors.primary "rgba(79, 70, 229, 0.35)" is translucent. The launcher shows your page through it, so its icon may be unreadable over dark content; pass a solid color.
whoo-aiden-widget: ignoring `theme.fonts.family` -- expected a font-family stack of at most 200 characters, without url(), @, ;, {, } or \.
whoo-aiden-widget: `theme.fonts.sizes.input` 13 is out of range (16-32); using 16.
whoo-aiden-widget: ignoring `theme.fonts.sizes.small` -- expected a positive number of pixels.
whoo-aiden-widget: ignoring `theme.launcher.icon` -- expected one of chat, message, sparkle.
whoo-aiden-widget: ignoring `theme.launcher.iconUrl` -- only https: and data:image/ URLs are allowed.
whoo-aiden-widget: `layout.launcherSize` 10 is out of range (24-120); using 24.
whoo-aiden-widget: `layout.panel.width` 200 is out of range (at least 280); using 280.
whoo-aiden-widget: `layout.cornerRadius` 40 is out of range (0-32); using 32.
whoo-aiden-widget: ignoring `layout.offset.x` -- expected a non-negative number of pixels; using 20.
whoo-aiden-widget: `layout.offset.x` 900 leaves no room for the launcher and panel in this viewport; it is held back.

The numbers, names and values in each message depend on what you passed. Troubleshooting shows how to use them.

Once the chat button is showing, a problem appears to the visitor inside the chat window. This covers a network error, a connection that drops while a reply is arriving, and an error from Aiden.

  • The window shows a short, plain message: “Something went wrong, please try again.” Screen readers announce it. Like all the widget’s text, it appears in the widget’s language. See Language options.
  • Any part of the reply that already arrived stays on screen above the message.
  • The text the visitor sent goes back into the message box, so they can try again without retyping it. If they had already started typing something new, the widget leaves that text alone.
  • The technical detail goes to the console.

Visitors can also see these messages:

  • “Looking that up for you…” appears when a reply takes longer than about eight seconds to start. It is a reassurance, not an error.
  • “Couldn’t send feedback” appears under a reply if rating it fails. This only applies if you turned on showFeedback.

A session runs out about 30 minutes after it starts. When a visitor sends a message or feedback after that, the widget first gets a new session, and the conversation carries on: with publishableKey it renews the session itself, and with sessionToken it asks getSessionToken. It does the same when Aiden refuses the session as invalid or expired (a 401). When Aiden refuses a message or feedback outright with the current session (a 403), the widget does not renew the session, and the visitor sees “Something went wrong, please try again.” When the widget tries to get a new session and cannot, the visitor’s message goes back into the message box, and the console shows could not renew the session. What the visitor sees depends on whether trying again could help:

  • “This chat session has expired. Reload the page to continue.” when Aiden or your server refused a new session: with sessionToken without getSessionToken, when getSessionToken returns an empty or already expired token, or with publishableKey when Aiden refuses to start a new session for the key, for example because the key was deleted or your website address was removed from its allowed addresses. This is a refusal of the new session itself, not the 403 on a message described above.
  • “Something went wrong, please try again.” when the problem may pass: getSessionToken threw an error or took longer than 15 seconds, the connection failed, or the key reached its daily limit. The next message the visitor sends tries again. Before widget version 0.9.0, these also showed the expired message.

If the visitor closes the chat window while the widget is still getting a new session, the widget stops waiting and puts their message back in the message box.

Aiden limits how many messages a chat can send, to protect your assistant from abuse and runaway costs. It refuses a message over a limit with a 429 and the name of the limit, which is different from the 403 refusal described above. From widget version 0.10.3, the widget tells the visitor which limit they reached, in the widget’s language, instead of “Something went wrong, please try again.”:

  • “You’re sending messages too quickly. Please wait a moment and try again.” when messages arrive faster than Aiden allows.
  • “Please wait for the current reply to finish.” when a message is sent while a reply is still arriving.
  • “The assistant is unavailable right now. Please try again later.” when your assistant has used up its messages for the day.

A session can also send only a limited number of messages. When a conversation reaches that limit, the widget gets a new session, the same way it renews an expired one, and sends the message again, so the conversation carries on without an error. Only if the new session is at its limit as well does the visitor see “This conversation has reached its message limit. Please try again later.” If the widget cannot get a new session at all, the visitor sees the session messages described above.

As with other errors, the message is announced by screen readers, and the visitor’s text goes back into the message box. You can change each text with messages. See Language options. Use a session token from your own backend explains getSessionToken.