Angular produces this error when you attempt a JSONP
request without providing the necessary support for it in the HttpClient
configuration.
To enable JSONP
support, you can do one of the following:
- add the
withJsonpSupport()
as an argument during theprovideHttpClient
function call (e.g.provideHttpClient(withJsonpSupport())
) whenbootstrapApplication
is used - import the
HttpClientJsonpModule
in your root AppModule, when NgModule-based bootstrap is used.## Debugging the error Make sure that the JSONP support is added into your application either by calling thewithJsonpSupport
function (whenprovideHttpClient
is used) or importing theHttpClientJsonpModule
module as described above.