i am using Angular 9 and its ivy compiler.
I try to lazy load a component with the dynamic import function and the componentFactoryResolver:
const comp = await import('path/component.ts').then(x => x.component)
const factory = this._resolver.resolveComponentFactory(comp);
this.viewContainerRef.createComponent(factory)
It works as expected, i can load the component and use it, but when the lazy loaded component uses a sibling component declared in the same module as the lazy loaded componente i get the following warning:
WARNING in ./src/app/core/components/component.html 1:0 Module parse failed: Unexpected token (1:0)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
The problem with this warning is, that it apparently creates .js files in the dist folder containing the warning.