如何在Web Worker中使用Azure App Insights?

问题描述 投票:0回答:1

我正在尝试使用Web Worker中的Azure应用见解。但是,当我为新对象提供适当的配置后调用loadAppInsights()方法时,出现以下错误。

TelemetryContext.js:29未捕获的TypeError:无法读取未定义的属性'automaticSession'

我认为这是由于工作线程中的窗口对象不可用。如何解决这个问题?我要跟踪Web Worker发出的所有XHR调用,因此需要在Web Worker中使用应用程序见解。

javascript angular azure azure-application-insights web-worker
1个回答
0
投票

对于遇到类似问题的人,此问题被识别为错误,在此处进行了详细讨论,并提供了一些处理异常的修补程序:

https://github.com/microsoft/ApplicationInsights-JS/issues/1149

© www.soinside.com 2019 - 2024. All rights reserved.