diff --git a/posthog-node/src/feature-flags.ts b/posthog-node/src/feature-flags.ts index 3aa938aa..09b6eb5b 100644 --- a/posthog-node/src/feature-flags.ts +++ b/posthog-node/src/feature-flags.ts @@ -105,7 +105,7 @@ class FeatureFlagsPoller { ): Promise { await this.loadFeatureFlags() - let response: string | boolean | PromiseLike | undefined = undefined + let response: string | boolean | undefined = undefined let featureFlag = undefined if (!this.loadedSuccessfullyOnce) { @@ -590,7 +590,6 @@ function matchCohort( } function matchPropertyGroup( - this: any, propertyGroup: PropertyGroup, propertyValues: Record, cohortProperties: FeatureFlagsPoller['cohorts'], @@ -627,7 +626,9 @@ function matchPropertyGroup( } } catch (err) { if (err instanceof InconclusiveMatchError) { - this.logMsgIfDebug(() => console.debug(`Failed to compute property ${prop} locally: ${err}`)) + if (debugMode) { + console.debug(`Failed to compute property ${prop} locally: ${err}`) + } errorMatchingLocally = true } else { throw err @@ -671,7 +672,9 @@ function matchPropertyGroup( } } catch (err) { if (err instanceof InconclusiveMatchError) { - this.logMsgIfDebug(() => console.debug(`Failed to compute property ${prop} locally: ${err}`)) + if (debugMode) { + console.debug(`Failed to compute property ${prop} locally: ${err}`) + } errorMatchingLocally = true } else { throw err