main-es2015.6f31d328c9edc909ac03.js:1 ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(i)[Se -> e]: StaticInjectorError(Platform: core)[Se -> e]: NullInjectorError: No provider for e!
I get the above error only when I do --prod build. FYI, the module is lazy loaded.
Any suggestions/help will be really appreciated.
Remove all the services from providers as you already have added providedIn: 'root'
OR try this
@NgModule({
providers: [
MyService
]
})
You have to add your service in app.module.ts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With