We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When sending data with mixpanel.track(event, data), if data contains unserializable data such as bigint, the call fails.
mixpanel.track(event, data)
data
bigint
It would be great to support bigint in mixpanel and automatically serialize them as string.
The current workaround is to call the following to manually convert these bigint into string so there are no errors in the mixpanel library.
mixpanel.track(event, JSON.parse( JSON.stringify(data, (key, value) => { if (typeof value === "bigint") return value.toString(); return value; }) ))
The text was updated successfully, but these errors were encountered:
you can patch toJSON method on BigInt class if you are sure that you want to send them as string.
toJSON
BigInt.prototype["toJSON"] = function () { return this.toString(); };
Sorry, something went wrong.
This is far from ideal as it is changing the default behavior of big int and can have many side effects. The vest case scenario would be to to the test during the stringify here https://github.com/mixpanel/mixpanel-node/blob/261a98b929e7c2ce6c99d8169335fb06b86ff8d9/lib/mixpanel-node.js#L71C35-L71C49
stringify
No branches or pull requests
When sending data with
mixpanel.track(event, data)
, ifdata
contains unserializable data such asbigint
, the call fails.It would be great to support
bigint
in mixpanel and automatically serialize them as string.The current workaround is to call the following to manually convert these bigint into string so there are no errors in the mixpanel library.
The text was updated successfully, but these errors were encountered: