Closed
Description
Which @angular/* package(s) are relevant/related to the feature request?
common
Description
Hi,
With the release of Angular v20.1 the devtools console is flooded with the following warnigns for each http request:
NG02813: Angular detected that a `HttpClient` request with the `keepalive` option was sent using XHR, which does not support it. To use the `keepalive` option, enable Fetch API support by passing `withFetch()` as an argument to `provideHttpClient()`.
NG02814: Angular detected that a `HttpClient` request with the `cache` option was sent using XHR, which does not support it. To use the `cache` option, enable Fetch API support by passing `withFetch()` as an argument to `provideHttpClient()`.
NG02815: Angular detected that a `HttpClient` request with the `priority` option was sent using XHR, which does not support it. To use the `priority` option, enable Fetch API support by passing `withFetch()` as an argument to `provideHttpClient()`.
NG02816: Angular detected that a `HttpClient` request with the `mode` option was sent using XHR, which does not support it. To use the `mode` option, enable Fetch API support by passing `withFetch()` as an argument to `provideHttpClient()`.
NG02817: Angular detected that a `HttpClient` request with the `redirect` option was sent using XHR, which does not support it. To use the `redirect` option, enable Fetch API support by passing `withFetch()` as an argument to `provideHttpClient()`.
NG02818: Angular detected that a `HttpClient` request with the `credentials` option was sent using XHR, which does not support it. To use the `credentials` option, enable Fetch API support by passing `withFetch()` as an argument to `provideHttpClient()`.
This can quickly get noisy and potentially hide other useful warnings.
Unfortunately, we can't simply use withFetch
because we require XHR's reportProgress
capabilities.
I noticed that these warnings are being issued for requests where these options were not set and have the default undefined
value or in the case of keepalive the default false
value.
Thoughts?
Thanks.
Proposed solution
Ideally, these should only be logged if the options are being set by the caller.
Alternatives considered
A way to disable those warnings globally.
Metadata
Metadata
Assignees
Labels
No labels