diff --git a/.changeset/fair-frogs-fetch.md b/.changeset/fair-frogs-fetch.md new file mode 100644 index 000000000..ad8fc69ec --- /dev/null +++ b/.changeset/fair-frogs-fetch.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Ignore errors from event flushing diff --git a/packages/gitbook/src/components/Insights/InsightsProvider.tsx b/packages/gitbook/src/components/Insights/InsightsProvider.tsx index b2b7f219c..6ae704451 100644 --- a/packages/gitbook/src/components/Insights/InsightsProvider.tsx +++ b/packages/gitbook/src/components/Insights/InsightsProvider.tsx @@ -241,6 +241,9 @@ function sendEvents(args: { body: JSON.stringify({ events, }), + }).catch((error) => { + // We don't want to throw when this fails. + console.error('Error sending events', error); }); }