flat-flag-71245
08/01/2026, 8:07 PMalert-cat-82573
08/01/2026, 8:22 PMflat-flag-71245
08/01/2026, 11:02 PMalert-cat-82573
08/02/2026, 6:55 AMflat-flag-71245
08/02/2026, 5:23 PM@BIG JIGGY$$$ Found it, here's the full picture:
1. Where it's installed: Directly in theme.liquid, right before </body>:
<script src="https://cdn.botpress.cloud/webchat/v3.7/inject.js"></script>
<script src="https://files.bpcontent.cloud/2026/05/27/17/20260527175841-4566349P.js" defer></script>
2. The code around (index):186 — turns out it's NOT Botpress's own script. It's my theme's (Kalles, by The4.co) own JS that globally overrides fetch/XHR to track cart events:
} else if (requestURL.includes("/cart/add")) {
cloneResponse.text().then( (text) => {
let item = JSON.parse(text);
self.singleCartItemDataLayer('add_to_cart', item);
self.updateCart();
});
} else if (requestURL.includes("/cart/change")) {
So my theme wraps window.fetch/XHR globally and assumes the URL argument passed to fetch is always a plain string. The console shows the crash happens during "Error sending event metrics" — so it looks like Botpress's webchat calls fetch with something that isn't a plain string (maybe a Request object?) when sending its own analytics/metrics, which breaks my theme's interceptor since Request.includes is not a function.
Does Botpress's webchat ever call fetch with a Request object or URL object internally instead of a plain string URL? That would explain why it only breaks on Shopify (which has this global fetch override) and works fine on a plain HTML page with no such override.alert-cat-82573
08/02/2026, 7:34 PM