A colleague sent me the following screenshot with an error he got after switching to an AOT build in Angular:
Here is the related TypeScript file for this component:
The problem was caused by the “template: require('./perceel-list.component.html')” statement in the component file. The aot build doesn’t like it when you try to resolve html templates dynamically.
Removing the require and just using the templateUrl instead solved the problem: