From 02c7ec3b77e01c80c2f27e9e04c9db4f029e8541 Mon Sep 17 00:00:00 2001 From: Rafael Audibert <32079912+rafaeelaudibert@users.noreply.github.com> Date: Fri, 7 Mar 2025 15:00:10 -0300 Subject: [PATCH] fix: Stop logging error when client is uninitialized (#1803) This causes errors on NextJS because it will be uninitialized on the server-side. We already make it pretty clear that you should control initializing the client when passing it in as a prop, so let's give up on the error log altogether --- react/src/context/PostHogProvider.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/react/src/context/PostHogProvider.tsx b/react/src/context/PostHogProvider.tsx index b68814243..f91130ef0 100644 --- a/react/src/context/PostHogProvider.tsx +++ b/react/src/context/PostHogProvider.tsx @@ -61,10 +61,6 @@ export function PostHogProvider({ children, client, apiKey, options }: WithOptio ) } - if (!client.__loaded) { - console.warn('[PostHog.js] you should provide an _initialized_ `client` to `PostHogProvider` .') - } - return client }