Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/khaki-spoons-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@segment/analytics-next': patch
---

Fix 'Promise is undefined' issue with ie11 polyfill
15 changes: 7 additions & 8 deletions packages/browser/src/browser/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ import {

let ajsIdentifiedCSP = false

const sendErrorMetrics = (() => {
const sendErrorMetrics = (tags: string[]) => {
// this should not be instantied at the root, or it will break ie11.
const metrics = new RemoteMetrics()
return (tags: string[]) => {
metrics.increment('analytics_js.invoke.error', [
...tags,
`wk:${embeddedWriteKey()}`,
])
}
})()
metrics.increment('analytics_js.invoke.error', [
...tags,
`wk:${embeddedWriteKey()}`,
])
}

function onError(err?: unknown) {
console.error('[analytics.js]', 'Failed to load Analytics.js', err)
Expand Down