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: Cannot set property 'distinctId' of undefined when call identify method #230

Open
klalex opened this issue Apr 11, 2024 · 4 comments

Comments

@klalex
Copy link

klalex commented Apr 11, 2024

After signup I call mixpanel.identify(email). It logs I see LOG [Mixpanel] Identify '...'. But then immediately get this error:

TypeError: Cannot set property 'distinctId' of undefined.

I've checked email has value. So it's not undefined. Even in mixpanel logs email is displayed for identify.

mixpanel.track() works as expected though.

@zihejia
Copy link
Collaborator

zihejia commented Apr 11, 2024

hi @klalex , do you mind sharing the full log and the code snippet that can reproduce the issue?

@klalex
Copy link
Author

klalex commented Apr 11, 2024

@zihejia I used example from docs:

const mixpanelToken = '...';
const mixpanel = new Mixpanel(mixpanelToken, false);
mixpanel.setLoggingEnabled(true);
mixpanel.init();
mixpanel.identify(email);

Also when I downgraded to version 2.4.1 it works now. So something wrong with version 3.0

@zihejia
Copy link
Collaborator

zihejia commented Apr 16, 2024

hi @klalex , would you like to try 3.0.2?

@enu-kuro
Copy link

enu-kuro commented May 5, 2024

I got the same error.
It should be "await mixpanel.init();" because the init function is an async function.

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

3 participants