I upgraded an Angular App from v8 to v9. The project imports a custom UI library using Angular 8 and moment.js.
When I build it:
In my case the issue was related to an imported library, that was not Angular v9 compatible (among other things it was not using deep links to Angular Material and moment.js).
I was lucky as the library is an intern one and I could fix these points and republish it. After that it built without any problems or changes in my project.