Skip to content

@angular/http not marked as peer dependency #5814

Closed
@cyrilletuzi

Description

@cyrilletuzi

Bug, feature request, or proposal:

Bug

What is the current behavior?

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

What is the use-case or motivation for changing an existing behavior?

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.

What is the expected behavior?

Material icons seems to do hard imports of @angular/http even if it doesn't need them. They should be remove when not necessary.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

@angular/cli 1.2.1
@angular/core 4.3.0
@angular/material beta.8

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions