Skip to content

Commit

Permalink
fix ambient import conflict (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky authored Oct 9, 2022
1 parent 317425f commit 5026ee1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-chefs-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@segment/analytics-next': patch
---

Fix ambient import conflict bug
7 changes: 5 additions & 2 deletions packages/browser/src/browser/standalone-analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface AnalyticsStandalone extends Analytics {

declare global {
interface Window {
analytics: AnalyticsStandalone
analytics: AnalyticsSnippet
}
}

Expand Down Expand Up @@ -67,5 +67,8 @@ export async function install(): Promise<void> {
return
}

window.analytics = await AnalyticsBrowser.standalone(writeKey, options)
window.analytics = (await AnalyticsBrowser.standalone(
writeKey,
options
)) as AnalyticsSnippet
}

0 comments on commit 5026ee1

Please sign in to comment.