mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-05 21:04:43 +08:00
🐛 Handle GA script load failure to prevent bot from hanging (#2446)
## Summary - Add `script.onerror` handler in `initGoogleAnalytics` so the promise resolves even when the GA script fails to load (ad blockers, network errors), preventing the bot from hanging indefinitely. - Bump `@typebot.io/js` and `@typebot.io/react` versions to `0.10.2`. ## Test plan - [ ] Enable a Google Analytics integration block in a bot - [ ] Block `googletagmanager.com` (e.g. via ad blocker) and verify the bot still loads - [ ] Check that `"Failed to load Google Analytics script"` appears in the console 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0969c4e525
commit
d3c15f32c8
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.10.1",
|
||||
"version": "0.10.2",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"license": "FSL-1.1-ALv2",
|
||||
"type": "module",
|
||||
|
||||
@ -34,6 +34,10 @@ export const initGoogleAnalytics = (id: string): Promise<void> => {
|
||||
script.onload = () => {
|
||||
resolve();
|
||||
};
|
||||
script.onerror = () => {
|
||||
console.error("Failed to load Google Analytics script");
|
||||
resolve();
|
||||
};
|
||||
}
|
||||
if (existingScript) resolve();
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.10.1",
|
||||
"version": "0.10.2",
|
||||
"description": "Convenient library to display typebots on your React app",
|
||||
"license": "FSL-1.1-ALv2",
|
||||
"type": "module",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user