title: Uncaught ReferenceError: Cannot access 'GA' before initialization
body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I have used <code>ng build --prod ---base-href=myapp</code> to build my module.</p>
  
  <p>What could've possibly gone wrong?</p>
  
  <p>Optional: 
  I have already tried  <code>"emitDecoratorMetadata": false</code> based on a <a href="https://stackoverflow.com/questions/56870661/angular-7-2-1-es6-class-referenceerror-cannot-access-x-before-initializatio">solution</a> on another thread. But still issue persists. </p>