Hi, I’m so sorry for replying after months, but I haven’t looked at Medium for a while, I hope that this comment will help you or any reader out there.
Yes, and it’s not easy to tell you where the error is. I have encountered this error 2 times in my projects, and it was:
1) When I tried to import a library generated with ng-packagr (the problem was in the config files or in Angular itself)
2) When the contents of forRoot(/**THESE**) could not be statically analyzed by Angular. All that you pass inside forRoot must be static (object with primitives, primitives, providers…), it doesn’t have to contain modules, for example.