diff --git a/src/posthog-core.ts b/src/posthog-core.ts index c728db5b8..c9c420a05 100644 --- a/src/posthog-core.ts +++ b/src/posthog-core.ts @@ -830,7 +830,7 @@ export class PostHog { // While developing, a developer might purposefully _not_ call init(), // in this case, we would like capture to be a noop. if (!this.__loaded || !this.sessionPersistence || !this._requestQueue) { - return logger.unintializedWarning('posthog.capture') + return logger.uninitializedWarning('posthog.capture') } if (userOptedOut(this)) { @@ -1249,7 +1249,7 @@ export class PostHog { */ identify(new_distinct_id?: string, userPropertiesToSet?: Properties, userPropertiesToSetOnce?: Properties): void { if (!this.__loaded || !this.persistence) { - return logger.unintializedWarning('posthog.identify') + return logger.uninitializedWarning('posthog.identify') } //if the new_distinct_id has not been set ignore the identify event if (!new_distinct_id) { @@ -1418,7 +1418,7 @@ export class PostHog { */ reset(reset_device_id?: boolean): void { if (!this.__loaded) { - return logger.unintializedWarning('posthog.reset') + return logger.uninitializedWarning('posthog.reset') } const device_id = this.get_property('$device_id') this.persistence?.clear() diff --git a/src/posthog-featureflags.ts b/src/posthog-featureflags.ts index 2bf092847..5a3970fd5 100644 --- a/src/posthog-featureflags.ts +++ b/src/posthog-featureflags.ts @@ -290,7 +290,7 @@ export class PostHogFeatureFlags { */ override(flags: boolean | string[] | Record): void { if (!this.instance.__loaded || !this.instance.persistence) { - return logger.unintializedWarning('posthog.feature_flags.override') + return logger.uninitializedWarning('posthog.feature_flags.override') } this._override_warning = false diff --git a/src/utils/index.ts b/src/utils/index.ts index 476cface1..467baa3ab 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -57,7 +57,7 @@ export const logger = { console.error(LOGGER_PREFIX, ...args) }, - unintializedWarning: (methodName: string) => { + uninitializedWarning: (methodName: string) => { logger.error(`You must initialize PostHog before calling ${methodName}`) }, }