title: NG3003: Angular 12 Circular Dependency in library - Ivy partial compilationMode
body: <p>I have an issue presented <a href="https://stackblitz.com/edit/angular-yic4ty?file=src%2Fapp%2Fparent.component.ts" rel="nofollow noreferrer">here</a>.<br>
  I have a <code>ParentComponent</code> which has a child <code>ChildComponent</code>,
  and child has <code>ParentComponent</code> inside of it so there is a cycle here.<br>
  This is the error I'm facing:</p>
  <pre><code>✖ Compiling with Angular sources in Ivy partial compilation mode.
  ERROR: projects/api/src/lib/api.component.ts:3:1
  error NG3003: One or more import cycles would need to be created to 
  compile this component, which is not supported by the current compiler
  configuration.
  
  The component 'ParentComponent' is used in the template but importing
  it would create a cycle:
   /lib/child/child.component.ts -&gt; /lib/parent/parent.component.ts -&gt; /lib/child/child.component.ts
  </code></pre>
  <p>This error only happens in Angular libraries. So as you can see there is no issue in <a href="https://stackblitz.com/edit/angular-yic4ty?file=src%2Fapp%2Fparent.component.ts" rel="nofollow noreferrer">stackblitz</a> example and it's just a demonstration.<br></p>
  <p>This error goes away with setting <code>&quot;compilationMode&quot;: &quot;full&quot;</code> in library's <code>tsconfig.lib.prod.json</code> file , but in that case, we loose backward compatibility! 
  <br></p>
  <p>The official doc says:</p>
  <blockquote>
  <p>Move the classes that reference each other into the same file, to avoid any imports between them.
  Blockquote</p>
  </blockquote>
  <p>And it works, But it's really an ugly way to do that! Also we have lots of components and we just can't do that!
  <br><br>
  Can you help me PLEASE?!
  <br>
  <a href="https://i.stack.imgur.com/bz09j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bz09j.png" alt="enter image description here" /></a></p>