title: Cannot read property 'ngModule' of undefined
body: <p>I have three module on app and one of them is main and is used in other two modules.
  When I start app and go straight to one of these modules who imports main module than this error show up in browser console:</p>
  <pre><code>core.js:4117 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'ngModule' of 
  
  undefined
  TypeError: Cannot read property 'ngModule' of undefined
      at isModuleWithProviders (core.js:26882)
      at expandModuleWithProviders (core.js:26876)
      at Array.map (&lt;anonymous&gt;)
      at Function.get (core.js:26534)
      at registerNgModuleType (core.js:24758)
      at core.js:24769
      at Array.forEach (&lt;anonymous&gt;)
      at registerNgModuleType (core.js:24769)
      at new NgModuleFactory (core.js:24872)
      at Compiler_compileModuleSync__POST_R3__ (core.js:27732)
      at resolvePromise (zone.js:832)
      at resolvePromise (zone.js:784)
      at zone.js:894
      at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
      at Object.onInvokeTask (core.js:28122)
      at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
      at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
      at drainMicroTaskQueue (zone.js:601)
  </code></pre>
  <p>But when I start app again and directly go to main module (he works and everything is okay), and after that I go to one of module who import main module than they are work.</p>
  <p>I think problem is about loading main module in these two modules.
  But i don't have clue what caused this reaction.</p>
  <p>If someone has advice what to try to resolve this solution just suggest in answer.</p>