File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
packages/browser/src/browser Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @segment/analytics-next ' : patch
3+ ---
4+
5+ Fix 'Promise is undefined' issue with ie11 polyfill
Original file line number Diff line number Diff line change @@ -31,15 +31,14 @@ import {
3131
3232let ajsIdentifiedCSP = false
3333
34- const sendErrorMetrics = ( ( ) => {
34+ const sendErrorMetrics = ( tags : string [ ] ) => {
35+ // this should not be instantied at the root, or it will break ie11.
3536 const metrics = new RemoteMetrics ( )
36- return ( tags : string [ ] ) => {
37- metrics . increment ( 'analytics_js.invoke.error' , [
38- ...tags ,
39- `wk:${ embeddedWriteKey ( ) } ` ,
40- ] )
41- }
42- } ) ( )
37+ metrics . increment ( 'analytics_js.invoke.error' , [
38+ ...tags ,
39+ `wk:${ embeddedWriteKey ( ) } ` ,
40+ ] )
41+ }
4342
4443function onError ( err ?: unknown ) {
4544 console . error ( '[analytics.js]' , 'Failed to load Analytics.js' , err )
You can’t perform that action at this time.
0 commit comments