From 5026ee1e69a16e4597bd9c95d57158f831e9b983 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Sun, 9 Oct 2022 09:11:04 -0500 Subject: [PATCH] fix ambient import conflict (#621) --- .changeset/rotten-chefs-eat.md | 5 +++++ packages/browser/src/browser/standalone-analytics.ts | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/rotten-chefs-eat.md diff --git a/.changeset/rotten-chefs-eat.md b/.changeset/rotten-chefs-eat.md new file mode 100644 index 000000000..27c3cd6b7 --- /dev/null +++ b/.changeset/rotten-chefs-eat.md @@ -0,0 +1,5 @@ +--- +'@segment/analytics-next': patch +--- + +Fix ambient import conflict bug diff --git a/packages/browser/src/browser/standalone-analytics.ts b/packages/browser/src/browser/standalone-analytics.ts index 18b73e76a..b89488006 100644 --- a/packages/browser/src/browser/standalone-analytics.ts +++ b/packages/browser/src/browser/standalone-analytics.ts @@ -14,7 +14,7 @@ export interface AnalyticsStandalone extends Analytics { declare global { interface Window { - analytics: AnalyticsStandalone + analytics: AnalyticsSnippet } } @@ -67,5 +67,8 @@ export async function install(): Promise { return } - window.analytics = await AnalyticsBrowser.standalone(writeKey, options) + window.analytics = (await AnalyticsBrowser.standalone( + writeKey, + options + )) as AnalyticsSnippet }