Skip to content

Commit b8c73cb

Browse files
fix: update PostHog import to support both ESM and CommonJS environments (#696)
* fix: update PostHog import to support both ESM and CommonJS environments Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> * fix: update test file to properly handle PostHog mocking Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> * fix: update test file to use vi.hoisted() for proper mock hoisting Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> * chore: remove observability tests as requested Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Max Prilutskiy <maks.prilutskiy@gmail.com>
1 parent 9baf857 commit b8c73cb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/fix-posthog-import.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
Fix PostHog import in CLI to support both ESM and CommonJS environments

packages/cli/src/cli/utils/observability.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { PostHog } from "posthog-node";
1+
import pkg from "posthog-node";
2+
const { PostHog } = pkg;
23

34
export default async function trackEvent(distinctId: string, event: string, properties?: Record<string, any>) {
45
if (process.env.DO_NOT_TRACK) {

0 commit comments

Comments
 (0)