Troubleshooting

Start with the console in your browser's developer tools, on the store page. Whenever Stylor doesn't show, or can't do part of its job, it writes a line starting with [Stylor] that says why and what to do.

The launcher doesn't appear

Check these in order:

  1. Is the script on the page? Look for widget.js in the Network tab. If it isn't there, the snippet isn't in the theme you are viewing, for example because it was pasted into an unpublished theme.
  2. Is publicKey set? Without it the console says [Stylor] StylorConfig.publicKey is required.
  3. What did the console say?
    • "The widget is not shown here: …" means it is not ready. The reason says which: no active dataset in scope (check datasetIds, and that a store is connected), a plan that doesn't include the assistant, or this period's allowance used up (check Usage).
    • "The public key was not accepted" means the key is wrong or deactivated. Copy the snippet again from the dashboard.
    • "The widget was refused on this website" means the key isn't allowed on this domain, or the organization has no active subscription. Add the domain to the key's allowed websites under API keys.
    • "Too many requests right now" means a rate limit was hit. It recovers on its own.
    • "The widget snippet is on this page more than once" means only the first copy runs. Remove the extra one.
  4. Did it fail to reach Stylor? [Stylor] Preflight failed means the request didn't complete: a network problem, a blocker extension, or a Content Security Policy. See Content Security Policy.

The launcher shows but the chat stays blank

The chat loads after your page has finished loading. If it hasn't appeared 20 seconds after a click, the console warns. The usual cause is a Content Security Policy without frame-src https://stylor.ai.

The assistant can't see the cart or the product

That is the page bridge. The console says so: "The page bridge … did not answer" when it is missing, and "The page bridge answers …, but the widget loads from …" when it was written for a different origin (an edited snippet, or baseUrl set). Check that:

  • the bridge (the second <script> in the snippet) is on the page, before widget.js;
  • it hasn't been edited, minified with a changed origin, or removed by a theme app;
  • your Content Security Policy allows 'unsafe-eval'.

Without the bridge, the assistant works but has no cart tools. See The page bridge.

The assistant searches the wrong catalogue

Without datasetIds, the assistant matches the website the shopper is on to a dataset's store connection. On a preview or staging domain that matches no store, it searches every active dataset. Set datasetIds to pin the catalogue.

The wrong theme shows

A snippet without themeId shows the theme changed most recently, so editing any theme changes it. Set the theme's id, or "none". See Themes and appearance.

Two launchers

A page shows one launcher, however many times the snippet is pasted. The console names the extra copy: "on this page more than once" for a second paste, or "already on this page" next to another Stylor embed, such as an app embed. Keep one.

Complete the look shows nothing

Nothing is drawn when there's nothing worth showing, and that's expected for many products: one with no model photo, or one whose outfit isn't in your catalogue. A refused key or website, or an error, is written to the console once, starting [Stylor] Complete the look. To see why a product shows nothing, set completeTheLook.debug: true and reload. The console logs where it looked for a place, how it identified the product, and what came back. See Complete the look.

Moving from the old widget

The first widget, /script/widget.js, has been retired. On a page that still loads it, the console says [Stylor] This widget has been retired. and nothing appears. Replace the whole snippet with a new one from the dashboard: the configuration, the page bridge, and /script/agent/v2/widget.js.