Open raronen opened 5 years ago
Hi @raronen, Can you try moving this import:
ReactiveComponentLoaderModule.withModule({
moduleId: 'editor',
loadChildren: '../editor/editor.module#EditorModule'
}),
...to your AppModule
?
That's probably where the issues comes from.
Let me know how it works for you.
I ommitted the .withModule
from LazyModule and put it in AppModule.
I actually tried that before, sadly, it didn't work.
Same error:
No module factory available for dependency type: ContextElementDependency
@raronen Have you had any success with this problem? Please let us know.
Yes, this issue seems to be covered here and here but those answered doesn't resolve this case. This case is different.
For one, I only have one version of webpack:
$ npm ls webpack analytics@1.0.0 C:\LA\src\LogAnalyticsPortalWebRole
-- @angular-devkit/build-angular@0.801.0-- webpack@4.35.2
Here is my code: editor.module.ts (the lazy loaded module):
lazy.module.ts (the module the contains the lazy load component):
app.module
editor-initiator.component.ts (the lazy load component):
I debugged the webpack code and I noticed that in Compilation.js:696
the
this.dependencyFactories
has the ContextElementDependency module in its map but for some reason thethis.dependencyFactories.get(dep.constructor)
returns undefined.I hope this can help.