When I run my angular application with ng serve it works. However when I am deploying (either Jboss or Tomcat Servers) same angular application it gives following at console:
Uncaught ReferenceError: Cannot access 'GA' before initialization
at main-es2015.faddfe3f773581d6c95a.js:1
at Module.zUnb (main-es2015.faddfe3f773581d6c95a.js:1)
at l (runtime-es2015.c5fa8325f89fc516600b.js:1)
at Object.0 (main-es2015.faddfe3f773581d6c95a.js:1)
at l (runtime-es2015.c5fa8325f89fc516600b.js:1)
at t (runtime-es2015.c5fa8325f89fc516600b.js:1)
at Array.r [as push] (runtime-es2015.c5fa8325f89fc516600b.js:1)
at main-es2015.faddfe3f773581d6c95a.js:1
I have used ng build --prod ---base-href=myapp
to build my module.
What could've possibly gone wrong?
Optional:
I have already tried "emitDecoratorMetadata": false
based on a solution on another thread. But still issue persists.