ocombe / ocLazyLoad

Lazy load modules & components in AngularJS
https://oclazyload.readme.io
MIT License
2.63k stars 510 forks source link

Silent failure for missing dependency while executing run block #329

Open lukaszbros opened 8 years ago

lukaszbros commented 8 years ago

I had an issue with one of my plugins that were lazy loaded through ocLazyLoad. In one of run blocks I was missing one of injected dependencies. But that caused all other plugins that were loaded in parallel run sections to fail as following forEach statement was broken by thrown exception. angular.forEach(tempRunBlocks, fn => { instanceInjector.invoke(fn); }); Additionally there was no error in console to see that there was an issue.

I would propose to add a try catch block with some logging to allow developers to easily find that kind of issues.

brandonroberts commented 8 years ago

@lukaszbros you should close this and reopen at https://github.com/angular/angular.js