> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hibonsai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Common integration issues and fixes for Bonsai web components

## Bonsai Search SDK

> [accordion] Colors don't change — I set the CSS variables and nothing happens
>
> Almost always `theme="dark"`.
>
> The dark palette is declared on an element **inside** the component's shadow root, which your page cannot reach by selector. It outranks page CSS, inline `style=""`, `!important`, and the Settings API alike, so 21 colour and shadow variables are silently discarded. `theme="auto"` has the same effect on a visitor whose system prefers dark.
>
> Fix: set `theme="light"` and supply the dark palette yourself. Do not simply drop the attribute — with no `theme` the component adopts `behavior.theme` from the Settings API, which may itself be dark. The full list and a copy-pasteable block are in [Dark theme](https://docs.hibonsai.com/project/docs/bonsai-search/styling.md#dark-theme).
>
> If a variable still doesn't apply after that, check it against the [reference table](https://docs.hibonsai.com/project/docs/bonsai-search/styling.md#reference-table) — `--bonsai-input-padding-x`, `--bonsai-input-border-radius` and `--bonsai-search-margin` are not variables the component reads.

> [accordion] `Failed to fetch` / no results when testing locally
>
> Requests are refused unless the page's origin is allowed for your organization, and the failed CORS preflight surfaces in the component as `Failed to fetch`.
>
> * Allowed automatically: the Bonsai dashboard, any `https://*.shopifypreview.com` preview, and — on non-production environments only — `http://localhost:3000` / `:3001` and the matching `127.0.0.1` ports.
> * **Everything else is per-organization**, including the localhost port you use against production. Ask your CSM which origins are registered for you, and to add the one you are developing on.
> * Files opened directly from disk (`file://`) send an origin of `null` and are never allowed. Serve the page over HTTP.
>
> If a page works on one port and not another, that is this list — not a bug in the embed.

> [accordion] The component renders but no results show
>
> * Confirm `api-key` is present and valid.
> * Confirm the page origin is registered (see above).
> * Inspect the browser console for network or CORS errors.

> [accordion] The console warns about `_bonsai_s`
>
> `no _bonsai_s shopper identifier on this page` means the Bonsai pixel is not installed. Search still works, but every event reports `NOT_SET` and cannot be joined to page views, orders or Concierge conversations. Install the [pixel](https://docs.hibonsai.com/project/docs/pixel.md).

> [accordion] Suggestions don't render
>
> * Ensure `suggestions` is a valid JSON array string.
> * Use single quotes around the attribute and double quotes inside the array.
> * A malformed `suggestions` attribute yields an empty list rather than falling back to the Settings API, and logs `Invalid suggestions JSON`.

> [accordion] Cards show "Image unavailable"
>
> * Confirm the product image URLs are reachable from the visitor's browser (an ad blocker or CSP `img-src` rule can block a CDN).
> * Use `missing-image-url` to supply your own fallback, or `hide-missing-images` to drop those results entirely.

> [accordion] Requests time out
>
> * Increase `timeout-ms` for slower networks.
> * Check ad blockers or CSP rules that might block the API domain.

> [accordion] I set `base-url` to a specific version and a different one is called
>
> Expected. The path in `base-url` is replaced at load time by the search version configured for your organization. Add `disable-search-path-override` to pin it — see [`base-url`](https://docs.hibonsai.com/project/docs/bonsai-search/config#api-configuration).

## Support

If you encounter any issues during integration or need assistance with customization, please contact your Customer Success Manager or reach out to our support team.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.