Skip to content

Missing dependency to @angular/forms #15085

Description

@rmedaer

Hi,

I just figured out (starting a new project) that there is a missing dependency when I build a Angular app with @angular/material without installing myself @angular/forms:

ERROR in node_modules/@angular/material/core/typings/error/error-options.d.ts(8,57): error TS2307: Cannot find module '@angular/forms'.
node_modules/@angular/material/core/typings/common-behaviors/error-state.d.ts(8,55): error TS2307: Cannot find module '@angular/forms'

Should we not add it as peer dependency ???

What is the expected behavior?

Install @angular/forms if needed by @angular/material.

What is the current behavior?

@angular/forms is not installed as dependency of @angular/material.

What are the steps to reproduce?

  • Start a new project (without the CLI schematics)
  • Install angular core packages and @angular/material
  • (Try to) build the application

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

 / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 7.2.3
Node: 10.13.0
OS: linux x64
Angular: 7.2.2
... animations, common, compiler, compiler-cli, core
... platform-browser, platform-browser-dynamic, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.12.3
@angular-devkit/build-angular 0.12.3
@angular-devkit/build-optimizer 0.12.3
@angular-devkit/build-webpack 0.12.3
@angular-devkit/core 7.2.3
@angular-devkit/schematics 7.2.3
@angular/cdk 7.3.1
@angular/cli 7.2.3
@angular/material 7.3.1
@angular/pwa 0.12.3
@angular/router 7.2.3
@ngtools/webpack 7.2.3
@schematics/angular 7.2.3
@schematics/update 0.12.3
rxjs 6.3.3
typescript 3.2.4
webpack 4.28.4

Is there anything else we should know?

No

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundtarget: majorThis PR is targeted for the next major release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions