Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: this.people.delete_user is undefined" when calling posthog.opt_out_capturing() #39

Closed
brianjychan opened this issue Jun 4, 2020 · 3 comments
Assignees

Comments

@brianjychan
Copy link

I'm loading PostHog via the npm module.

Then, in my React app's logic, when I run the following (awhile after init has already completed):

posthog.identify('testUser')
posthog.opt_out_capturing();

I get the error:
TypeError: this.people.delete_user is not a function. (In 'this.people.delete_user()', 'this.people.delete_user' is undefined)

I also tried switching the order of those two lines, which results in no errors thrown. However, in both cases autocapture events are still sent through.

I might be following an incorrect usage pattern. Am I missing something?

@mariusandra mariusandra self-assigned this Jul 16, 2020
@mariusandra
Copy link
Collaborator

This was solved a while ago. The problem was IIRC with loading posthog via npm.

@JayGray
Copy link

JayGray commented Oct 7, 2020

@mariusandra any details on how or which commit solved this because I still face the error.
Version: 1.4.5
Module: npm

Error:

module.js:5371 Uncaught TypeError: this.people.delete_user is not a function
    at PostHogLib.push.OKHC.PostHogLib.opt_out_capturing (module.js:5371)
    at <anonymous>:1:16

Thx

@mariusandra mariusandra reopened this Oct 22, 2020
@mariusandra mariusandra assigned macobo and unassigned mariusandra Oct 22, 2020
macobo added a commit that referenced this issue Nov 11, 2020
Fixes issue #39

Relevant code in people was removed in commit
b6b39a9, we don't handle $delete events
in our capture backend.
@macobo macobo closed this as completed Nov 24, 2020
@macobo
Copy link
Contributor

macobo commented Nov 24, 2020

Sorry for the late note - fix has landed, will be patched in the upcoming released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants