This error message is caused by including something that should be imported in declarations rather than imports in your app.module.ts.
So yep, the problem is caused by not correctly importing something.
Just thought I’d comment here in case someone else comes here from google. Wouldn’t want them incorrectly believing this doesn’t have anything to do with imports.
OP was asking about usage #1, which I said (and still believe) is not relevant to the error message. You seem to be talking about usage #2.
At the time this thread was created, I believe the proper place for putting HttpClient in an app module was providers. It definitely wasn’t declarations, which is for components.
In that spirit, the proper thing to do today is add HttpClientModule to the imports section of your AppModule.