I have an angular universal project which is using azure application insights to log exceptions.
When using angular universal I get an error because the library uses a shim, which expects 2 global variables to be declared. I understand the declare keyword is used to declare a variable which references a global variable, that way you can write code relying on a global that isnt known in your library.
Here is the shim: https://github.com/microsoft/ApplicationInsights-JS/blob/master/tools/shims/src/applicationinsights-shims.ts
It has these lines:
declare var __extends:(d: any, b: any) => any;
declare var __assign:(t: any) => any;
And here is the error I get:
ReferenceError: __assign is not defined
Supposedly these two variables are default globals for typescript but I cant find any information on that, clearly something is going wrong with the server side render. If I dont use Angular Universal I dont get the error.
Edit: I realised I was using a package named domino to polyfill the global window object, and I guess the polyfill was missing something. I removed it because Angular comes with ways to handle cross-platform execution with such a polyfill.