Add onError handler for posthog init
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 609
- Forks
- 343
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 312
Description
One major problem with Posthog is that ad blockers are blocking it. Which I'm fine with for analytics. But because I also use posthog for feature flags that is core functionality, that a user would likely want to work.
However right now, if you have an adblocker like the default one in Brave Browser, posthog init will just fail and keep retrying. But there's no way to catch the error and prompt the user that they might want to disable their adblocker.
Please add an onError handler to catch the error when it fails to init for whatever reason.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no file or test; start by locating the PostHog initialization and retry path in the TypeScript SDK. Trace how initialization failures are surfaced, then add the requested onError behavior and verify that an initialization failure reaches the handler without breaking feature-flag use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100