aniket7824
aniket7824

Reputation: 128

How to use Azure App Insights inside web worker?

I was trying to use Azure app insights inside the web worker. But when I am calling loadAppInsights() method after providing proper config to a new object, I am getting the following error.

TelemetryContext.js:29 Uncaught TypeError: Cannot read property 'automaticSession' of undefined

I think this is due to unavailability of the window object in the worker thread. How to solve this issue? I need to use app insights inside web worker as I want to track all XHR calls made from web worker.

Upvotes: 0

Views: 383

Answers (1)

Bhargavi Annadevara
Bhargavi Annadevara

Reputation: 5502

For those running into similar problems, this issue was identified as a bug and discussed in length here with a few fixes given to handle exceptions:

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

Upvotes: 1

Related Questions