title: Uncaught TypeError: t.rgb is not a function
body: <blockquote>
    <p>Uncaught TypeError: t.rgb is not a function</p>
  </blockquote>
  
  <p>I created an angular application, built it, and am attempting to serve it </p>
  
  <pre><code>$ ng serve --prod --aot 
  </code></pre>
  
  <p>This results in the following error in the console</p>
  
  <pre><code>Uncaught TypeError: t.rgb is not a function
      at HO (color.js.pre-build-optimizer.js:227)
      at GO (color.js.pre-build-optimizer.js:232)
      at rgb.js.pre-build-optimizer.js:36
      at RH (ramp.js.pre-build-optimizer.js:4)
      at Module.zUnb (BrBG.js.pre-build-optimizer.js:16)
      at f (bootstrap:78)
      at Object.0 (index.js.pre-build-optimizer.js:26)
      at f (bootstrap:78)
      at t (bootstrap:45)
      at Array.r [as push] (bootstrap:32)
  </code></pre>
  
  <p>The application does not display </p>
  
  <p>When I build the application without minifying (the <code>--prod</code> flag) it works.</p>
  
  <p>I am only seeing this issue when using D3 </p>
  
  <p>D3 ^5.9.1 . 
  Angular version 7.3.9 . 
  typescript 3.2.4  </p>
  
  <p>I have tried many combinations of versions with no luck.</p>
  
  <p>It also runs successfully when I pass <code>--optimization=false</code>
  I have been unable to debug this so far. This is <em>very</em> similar to <a href="https://stackoverflow.com/q/50448326/3639023">this question</a> however the solutions does not apply to this situation</p>
  
  <p>Please let me know if any additional information would be useful. </p>