In my angular 6 application I'm trying to dynamically load a module using SystemJsNgModuleLoader.load() but it always fails with a "Cannot find module" error.
This small sample program on GitHub reproduces the problem. It is nothing more than a new Angular-CLI generated project with one additional module which I try to load dynamically. It fails with the following error message in the console:
Error: Uncaught (in promise): Error: Cannot find module "src/app/lazy/lazy.module".
What's going wrong here?
Note: I was trying to reproduce the problem on StackBlitz before. However that was misleading since the error message was slightly different:
Error: Uncaught (in promise): Error: Cannot find 'LazyModule' in 'app/lazy/lazy.module'
It turned out (thanks to Cam Plimsoll) that I was just using the wrong path in that example.