From 5b4e9e74e597abc496d24c1ef7d21abf97fcce72 Mon Sep 17 00:00:00 2001 From: Jamil Date: Sat, 31 Dec 2022 15:40:23 -0600 Subject: [PATCH] Don't assume PostHog is available (#1258) Fixes #1257 --- docs/src/components/InstallBlock/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/components/InstallBlock/index.js b/docs/src/components/InstallBlock/index.js index ad84b5222..ec91c8e7d 100644 --- a/docs/src/components/InstallBlock/index.js +++ b/docs/src/components/InstallBlock/index.js @@ -6,7 +6,11 @@ export default function InstallBlock() { return ( Loading...}> {() => { - const distinct_id = window.posthog.get_distinct_id() + if (window.posthog && typeof window.posthog.get_distinct_id === "function") { + const distinct_id = window.posthog.get_distinct_id() + } else { + const distinct_id = "posthog-blocked" + } return (