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:
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 (<anonymous>)
at Function.get (core.js:26534)
at registerNgModuleType (core.js:24758)
at core.js:24769
at Array.forEach (<anonymous>)
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)
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.
I think problem is about loading main module in these two modules. But i don't have clue what caused this reaction.
If someone has advice what to try to resolve this solution just suggest in answer.