it helps some times This is probably due to the differences of JIT (just-in-time) and AOT (ahead-of-time) compiler. Read more about this in the docs. If you run ng serve or ng build it will use JIT by default. With the --prod flag however, AOT is used.
NullInjectorError: No provider for String! in angular 6
wish help you to fix your issue Any parameter added to service angular will try to inject this by DI system. DataService considers the base class for api service in this case and we don't need to make it injectable. So just remove the injectable decorator DataService
To fix the issue you can do I have implemented a simple angular application that has a component that calls a service which in turn calls an api. I have registered the service in the provider of the app module but getting the following error . , Add