Bug
If @angular/http is installed but HttpModule not loaded in AppModule, compilation is OK and icons work well (the font is loaded locally so no server requests are needed).
But if @angular/http is uninstalled, Angular CLI compilation fails (and so I can't even run my app) :
ERROR in/node_modules/@angular/material/typings/icon/icon-registry.d.ts (10,22): Cannot find module '@angular/http'.
ERROR in ./~/@angular/material/@angular/material.es5.js
Module not found: Error: Can't resolve '@angular/http' in '/node_modules/@angular/material/@angular'
@ ./~/@angular/material/@angular/material.es5.js 20:0-37
@ ./src/app/core/core.module.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
Angular 4.3 introduced new HttpClient API, meaning we may not need anymore the previous Http API. And in this case, we should be able to not install @angular/http in the project, to have smaller bundles sizes.
Material icons seems to do hard imports of @angular/http even if it doesn't need them. They should be remove when not necessary.
@angular/cli 1.2.1
@angular/core 4.3.0
@angular/material beta.8
The real issue here is that @angular/http should be a peerDependency of Angular Material; the library needs to import symbols from @angular/http to even compile.
We are likely going to switch to the new http client eventually (@angular/common/http), so this will likely be resolved then.
Any clue on this issue? We are running on the same problem 28 days later. Thanks guys!
PS: this is blocking issue given we cannot compile anymore. We had to install @angular/http and now have a larger bundle :/
I believe that material now uses common/http so this issue is now obsolete and could be closed.
Not yet, the PR is not merged. Mine is closed because it was ignored and the same work has been redone in another PR by a team member...
Please correct this bug
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Any clue on this issue? We are running on the same problem 28 days later. Thanks guys!
PS: this is blocking issue given we cannot compile anymore. We had to install @angular/http and now have a larger bundle :/