You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a minimal node http handler I'm trying to use posthog to capture an event. I'm seeing a ~10 second timeout when waiting on the call to shutdown(). At that time I get the error:
ERROR Error while shutting down PostHog HTTP error while fetching PostHog: 400
at retriable (node_modules/posthog-core/src/index.ts:652:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at retriable (node_modules/posthog-core/src/utils.ts:27:19)
at PostHog.fetchWithRetry (node_modules/posthog-core/src/index.ts:635:12)
at PostHog._flush (node_modules/posthog-core/src/index.ts:605:7)
How to reproduce
This is a Nuxt project backend running in node 20.
I'm not to posthog, and a hack front end person, I'm probably doing something silly. I'm getting front end events through just fine using the same api key, but none of my backend events show up, and get a 400 instead.
The text was updated successfully, but these errors were encountered:
Oh... I may have found it... distinctId is different than distinct_id. Changing that seems to make the difference.
Chalking this one up to new-userism... might want a documentation change at https://posthog.com/docs/libraries/node. Seeing distinct_id so much stuck in my head. maybe switch up the examples, or get smarter users.
I think we should perhaps do some more SDK side alerting if a call happens without a distinctId. Most people seem to use Typescript which indicates this immediately but we may need to rely on that less...
marandaneto
changed the title
~10 second timeout awaiting client.shtdown()
call without distinctId (mandatory) causes ~10 second timeout awaiting client.shtdown()
Sep 3, 2024
Bug description
In a minimal node http handler I'm trying to use posthog to capture an event. I'm seeing a ~10 second timeout when waiting on the call to shutdown(). At that time I get the error:
ERROR Error while shutting down PostHog HTTP error while fetching PostHog: 400
at retriable (node_modules/posthog-core/src/index.ts:652:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at retriable (node_modules/posthog-core/src/utils.ts:27:19)
at PostHog.fetchWithRetry (node_modules/posthog-core/src/index.ts:635:12)
at PostHog._flush (node_modules/posthog-core/src/index.ts:605:7)
How to reproduce
This is a Nuxt project backend running in node 20.
Additional context
I'm not to posthog, and a hack front end person, I'm probably doing something silly. I'm getting front end events through just fine using the same api key, but none of my backend events show up, and get a 400 instead.
The text was updated successfully, but these errors were encountered: