[BUG] window is not defined
at _getStackFromErrorObj
#2162
Labels
Milestone
window is not defined
at _getStackFromErrorObj
#2162
Description/Screenshot
I connected the Application Insights JavaScript SDK to my Nuxt 3 app on both sides - server and client, and in my Application Insights events I see this log with the following message for the tracked exception value:
ReferenceError: window is not defined at _getStackFromErrorObj (/app/.output/server/node_modules/@microsoft/applicationinsights-web/dist/es5/applicationinsights-web.js:6331:22)
And in your code I found this line that causes this issue - link.
I understand it might be happening because I use the Application Insights package for the web and some methods might be executed during SSR, but it's a little bit annoying because this check for the existing window is not correct.
"@microsoft/applicationinsights-web": "^3.0.2"
Expected behavior
There is no such a log in Application Insights tracked exceptions. The usage should be isomorphic or at least fault-tolerant for such cases.
Additional context
Thanks for your work and I will be glad to update this issue with more information for a speedy solution.
The text was updated successfully, but these errors were encountered: