0

While upgrading to the newest version of Angular, I am getting the following error:

ERROR Error: StaticInjectorError(AppModule)[options]:
 StaticInjectorError(Platform: core)[options]:
   NullInjectorError: No providor for options!

I've gotten similar errors during this upgrade but was able to find the missing service provider because it will be listed where the [options] is. However, I don't see anywhere in my code where I'm injecting an [options] service. How would I be able to determine where this service is being used or what the service even is so that I can provide it?

John
  • 131
  • 1
  • 3
  • can you post some code? – federico scamuzzi Sep 11 '18 at 12:37
  • Due to the nature of my project, I can't. I'm more asking for how to debug this though. Is there a way to console log what the name of the service is? – John Sep 11 '18 at 12:49
  • What is `options`? Is this your `service name`? – Shashikant Devani Sep 11 '18 at 13:07
  • That's the problem. I'm not sure what options is and I'm trying to figure out how to find that out and find out where it's being used. – John Sep 11 '18 at 13:13
  • Maybe just try to comment out all services till it works and then narrowing down the failure. Also are using Angular Logger Packet? https://stackoverflow.com/questions/43219039/how-to-debug-angular-2-aot-failures/43410786#43410786 – Daniel Habenicht Sep 11 '18 at 15:17
  • I'm not using Angular Logger, but I guess I'll start commenting things out. I was hoping that there would be a cleaner solution though. – John Sep 11 '18 at 16:03
  • I found what my error was. I upgraded angular2-notifications from 0.4.46 to 1.0.4 as part of my Angular 6 upgrade and was still importing SimpleNotificationsModule instead of SimpleNotificationsModule.forRoot(). It would be nice if Angular gave some more clear error messaging for this. – John Sep 11 '18 at 17:40

0 Answers0