| name | posthog-common-errors |
| description | Diagnose and fix common PostHog errors: events not appearing, flags returning
undefined, 401/429 errors, SDK initialization failures, and identity issues.
Trigger: "posthog error", "fix posthog", "posthog not working",
"debug posthog", "posthog events missing", "posthog broken".
|
| allowed-tools | Read, Grep, Bash(curl:*) |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","posthog","debugging"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
PostHog Common Errors
Overview
Diagnosis and solutions for the most common PostHog integration errors. Covers event capture failures, authentication issues, feature flag problems, identity fragmentation, and SDK initialization errors.
Prerequisites
- PostHog SDK installed (
posthog-js or posthog-node)
- Access to browser console or server logs
- PostHog project API key (
phc_...) available
Instructions
Error 1: Events Not Appearing in Dashboard
Symptoms: posthog.capture() calls execute without error but events never show in PostHog Activity tab.
Diagnoses and fixes:
const posthog = new PostHog('phc_...');
posthog.capture({ distinctId: 'user-1', event: 'test' });
await posthog.shutdown();
posthog.init('phc_...', {
api_host: 'https://app.posthog.com',
});
posthog.init('phc_...', {
api_host: 'https://us.i.posthog.com',
});