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

Got Error: socket hang up #226

Open
akshitkrnagpal opened this issue Nov 10, 2023 · 1 comment
Open

Got Error: socket hang up #226

akshitkrnagpal opened this issue Nov 10, 2023 · 1 comment

Comments

@akshitkrnagpal
Copy link

Hi

We have recently integrated mixpanel-node to send serverside events. Most of the events are being recorded but once in a while we get the following error and the event is NOT recorded.

ERROR   /node_modules/mixpanel/lib/mixpanel-node.js:156 mixpanel        Got Error: socket hang up

We would like some guidance to make sure we are sending all events without any data loss.

@AksAman
Copy link

AksAman commented Dec 27, 2023

This mainly happens in serverless functions due to the calling route closing before completing the request to mixpanel.

As mentioned in (#175 (comment)), Wrapping the tracking code with a promise solved this issue for me.

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

2 participants