Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When trying to load an .svg into the MatIconRegistry without including the provideHttpClient provider, the error message printed to the console will be:
Could not find HttpClient provider for use with Angular Material icons. Please include the HttpClientModule from @angular/common/http in your app imports.
This error message is misleading, as the method for correcting the issue is to use the provider provideHttpClient as described by the depreciated comment on the HttpClientModule.
Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-blslak
Steps to reproduce:
- Add an icon to the MatIconRegistry inside example-component.ts.
- Remove deprecated module HttpClientModule from main.ts.
- Observe the error message in the console.
Expected Behavior
The error message refers to provideHttpClient() as the proper solution to the issue.
Actual Behavior
The error message refers to a deprecated feature which is inconsistent with other documentation of the MatIconRegistry.
Environment
- Angular: 18.1.3
- CDK/Material: 18.1.4
- Browser(s): Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Windows