Uncaught TypeError: t.rgb is not a function
I created an angular application, built it, and am attempting to serve it
$ ng serve --prod --aot
This results in the following error in the console
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)
The application does not display
When I build the application without minifying (the --prod
flag) it works.
I am only seeing this issue when using D3
D3 ^5.9.1 . Angular version 7.3.9 . typescript 3.2.4
I have tried many combinations of versions with no luck.
It also runs successfully when I pass --optimization=false
I have been unable to debug this so far. This is very similar to this question however the solutions does not apply to this situation
Please let me know if any additional information would be useful.