title: ERROR in Maximum call stack size exceeded production build error after upgrading from CLI 1.6.6/Angular 4.4.6 to 1.7.2/5.2.9
body: <p>I followed these steps to upgrade my project.</p>
  
  <blockquote>
    <p><strong>Get latest of branch to a clean folder.</strong></p>
    
    <p>Package.json (shouldn't be necessary, just confirm) Update all angular
    versions to ^5.2.9 Update typescript to ~2.4. Update angular material
    to ^5.2.4</p>
    
    <p><strong>In terminal npm</strong> </p>
    
    <p>uninstall -g @angular/cli </p>
    
    <p>npm cache verify</p>
    
    <p>npm install -g @angular/cli@latest</p>
    
    <p><strong>In project folder</strong>   </p>
    
    <p><strong>In PowerShell</strong> rm -r -fo node_modules</p>
    
    <p><strong>In terminal</strong><br>
      npm install -save-dev @angular/cli@latest   </p>
    
    <p>npm install</p>
    
    <p>Update all rxjs calls appropriately, replace any Http references with appropriate HttpClient.</p>
  </blockquote>
  
  <p>Now when I build with "ng build -e local" or "ng serve -e local" I have no problems. When I build with "ng build --prod" I get the following, supremely useful, error:</p>
  
  <pre><code>C:\Users\&lt;folder&gt;\Documents\GitHub\&lt;projectfolder&gt;&gt;ng build --prod
  Date: 2018-04-10T07:30:53.137Z
  Hash: d8d8cd6ce7a9bbd203f1
  Time: 8314ms
  chunk {scripts} scripts.7995f282f7b5e2981da2.bundle.js (scripts) 170 kB [initial] [rendered]
  chunk {0} styles.3ec3a6ced34b0ab98f04.bundle.css (styles) 819 kB [initial] [rendered]
  chunk {1} polyfills.997d8cc03812de50ae67.bundle.js (polyfills) 84 bytes [initial] [rendered]
  chunk {2} main.ee32620ecd1edff94184.bundle.js (main) 84 bytes [initial] [rendered]
  chunk {3} inline.318b50c57b4eba3d437b.bundle.js (inline) 796 bytes [entry] [rendered]
  
  WARNING in Invalid font values at 249:2. Ignoring.
  
  ERROR in Maximum call stack size exceeded
  </code></pre>
  
  <p>At this point I'm at a loss. I don't want to revert because of the angular animations bug in our current version which causes UI elements to remain on the screen if there is an unhandled exception (yes, I know that shouldn't be the case but .. real world). But I'm still fairly new (only about 6 months on Angular stack) and I really don't know where to begin figuring out the issue based on that error message. Before doing the upgrade, it built fine in production mode.</p>
  
  <p>Any hints on debugging this issue would be greatly appreciated!</p>
  
  <p>Results of "ng -v"</p>
  
  <pre><code>Angular CLI: 1.7.4
  Node: 6.10.3
  OS: win32 x64
  Angular: 5.2.9
  ... animations, common, compiler, compiler-cli, core, forms
  ... http, platform-browser, platform-browser-dynamic, router
  
  @angular/cli: 1.7.4
  @angular/material: 5.2.4
  @angular-devkit/build-optimizer: 0.3.2
  @angular-devkit/core: 0.3.2
  @angular-devkit/schematics: 0.3.2
  @ngtools/json-schema: 1.2.0
  @ngtools/webpack: 1.10.2
  @schematics/angular: 0.3.2
  @schematics/package-update: 0.3.2
  typescript: 2.4.2
  webpack: 3.11.0
  </code></pre>