DI Error
OS?
Windows10
Versions.
@angular/cli: 1.0.0-beta.31 node: 7.2.0 os: win32 x64 @angular/common: 2.4.7 @angular/compiler: 2.4.7 @angular/core: 2.4.7 @angular/forms: 2.4.7 @angular/http: 2.4.7 @angular/platform-browser: 2.4.7 @angular/platform-browser-dynamic: 2.4.7 @angular/router: 3.4.7 @angular/cli: 1.0.0-beta.31 @angular/compiler-cli: 2.4.7
Repro steps.
ng serve
The log given by the failure.
Error: DI Error at NoProviderError.ZoneAwareError (http://localhost:4200/polyfills.bundle.js:816:33) at NoProviderError.BaseError [as constructor] (http://localhost:4200/vendor.bundle.js:31581:16) at NoProviderError.AbstractProviderError [as constructor] (http://localhost:4200/vendor.bundle.js:63280:16) at new NoProviderError (http://localhost:4200/vendor.bundle.js:63342:16) at ReflectiveInjector_.throwOrNull (http://localhost:4200/vendor.bundle.js:88631:19) at ReflectiveInjector.getByKeyDefault (http://localhost:4200/vendor.bundle.js:88670:25) at ReflectiveInjector.getByKey (http://localhost:4200/vendor.bundle.js:88602:25) at ReflectiveInjector.get (http://localhost:4200/vendor.bundle.js:88471:21) at AppModuleInjector.get (/AppModule/module.ngfactory.js:364:154) at AppModuleInjector.get (/AppModule/module.ngfactory.js:384:164) at AppModuleInjector.getInternal (/AppModule/module.ngfactory.js:617:50) at AppModuleInjector.NgModuleInjector.get (http://localhost:4200/vendor.bundle.js:64215:44) at CompiledTemplate.proxyViewClass.AppView.injectorGet (http://localhost:4200/vendor.bundle.js:89406:45) at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (http://localhost:4200/vendor.bundle.js:89834:49) at ElementInjector.get (http://localhost:4200/vendor.bundle.js:88910:27)
Mention any other details that might be useful.
I have a Shared Module that import in the App Module and LoginModule.
When I import the services inside the constructor, get the DI ERROR

- Are you sure your providers in
SharedModuleincludes both theAPIServiceandUtilsService? - Are you sure
AppModuleimportsSharedModule.forRoot()and not justSharedModule?
This feels to me it's a problem with Angular itself, not the CLI. You should file an issue on http://github.com/angular/angular. I'm going to close this but if you think that it is a problem with the CLI just answer here.
Did you submit the issue to http://github.com/angular/angular ?? I'm having a similar issue
getting the similar issue on my angular2 app, but its not consistent and comes anonymously, any help ?
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.