I'm trying to make a custom module that holds all my UI components, you can found it here: dawere-uic
It compiles and it works like a charm with the storybook I have on it, every UI component is working. The thing is when I try to use it on my main project I'm getting this error:
Uncaught TypeError: Cannot read property 'ɵmod' of undefined
at getNgModuleDef (core.js:1117)
at recurse (core.js:25171)
at recurse (core.js:25182)
at registerNgModuleType (core.js:25167)
at new NgModuleFactory$1 (core.js:25281)
at compileNgModuleFactory__POST_R3__ (core.js:28915)
at PlatformRef.bootstrapModule (core.js:29161)
at Module.zUnb (main.ts:11)
at __webpack_require__ (bootstrap:79)
at Object.0 (main.js:11)
It happens as soon as I import it in the app.module. Can anyone tell me what I'm doing wrong? I think it's worth mentioning though that I'm new to Angular.
Simply just return the module.
{
path: 'auth',
loadChildren: () =>
import('./auth/auth.module')
.then((a) => {
return a.AuthModule;
});
},
I got the same error but eventually found out that my lazy load script was wrong, that was what I had:
path: 'modulePath', loadChildren: () => import ('./exemple-module/exemple-module.module').then (m => { m.exemple-module })
This is what it should have been:
path: 'modulePath', loadChildren: () => import ('./exemple-module/exemple-module.module').then (m => m.exemple-module)
I did not return the module in the arrow function. Not sure if this helps, but this is the problem I had and how I solved it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With