title: Problems with enabling Ivy in Angular 10
body: <p>We have a problem with our angular app.</p>
  <p>We recently updated to angular 10 and enabled Ivy and aot.</p>
  <p>Now we are running into several problems that we are not able to solve.</p>
  <p><strong>Here is a quick overview of our setup</strong></p>
  <p>The app is enterprise sized and contains several libraries which depend on each other.</p>
  <p>These libraries are then used in other angular applications/workspaces which themselves contain libraries that are used further.</p>
  <p>Here is a simple illustrations of our setup:</p>
  <p>Core repository:</p>
  <pre><code>CoreApp
  --projects
  ---coreLibA
  ---coreLibB
  --src
  ---components &lt;-- uses code from coreLibs
  </code></pre>
  <p>User Repository</p>
  <pre><code>UserApp
  --projects
  ---userLibA &lt;-- uses core libs
  ---userLibB &lt;-- uses core libs
  --src
  ---components &lt;-- uses core libs as well as code from userLibs
  </code></pre>
  <p>The core-libraries are build into a folder and are consumed by the user-application from that folder through NPM.</p>
  <p>This works well with angular 10 without ivy.</p>
  <p><strong>First Problem</strong></p>
  <p>So, at first we enabled Ivy everywhere (libraries and applications). We were able to build the <code>coreLibs</code> without problems and install them into the <code>userApp</code> as well. <code>ng serve</code> on the <code>userApp</code> works as well. But when we tried to build the <code>userLibs</code> we encounter following error:</p>
  <pre><code>ERROR: Cannot resolve type entity i4.CommonModule to symbol
  An unhandled exception occurred: Cannot resolve type entity i4.CommonModule to symbol
  </code></pre>
  <p>We were able to solve some of these errors by removing imported modules in ngModules that were not necessary. But sadly, we couldn't solve all the issues.</p>
  <p>We still don't understand why this error occurs only with ivy and what it actually means.</p>
  <p><strong>Second Problem</strong></p>
  <p>We then tried to build the libraries without ivy but still run the application with ivy.</p>
  <p>This way we were able to build the <code>userLibs</code>  without problems. But when we tried to <code>ng serve</code> following error occurs:</p>
  <pre><code>ERROR in the target entry-point &quot;coreLibB&quot; has missing dependecies:
   - @angular/localize/init
   - @angular/cdk/platform
   - rxjs/operators
   - coreLibA
   ... and some more
  </code></pre>
  <p>We tried to work around that by adding hard dependencies in the libraries package.json and whitelist them in the ng-package.json. That worked, but npm install ran out of memory. So this is not a solution either.</p>
  <p><strong>Conclusion</strong></p>
  <p>It seems that Ivy is much stricter that View Engine. But we need Ivy to use the new localization feature of angular 10.</p>
  <p>So we would really appreciate help with this problem. We know that we probably didn't provide enough information, but we just don't know what information is needed. So just let us know and we deliver.</p>
  <p>Thanks for your help</p>