Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@angular/forms Generic type 'Type<T>' requires 1 type argument(s)

I upgraded Node and NPM and reinstalled Angular CLI(angular-cli: 1.0.0-beta.11-webpack.8, node: 6.5.0, os: linux x64), generated a foo project which worked fine. Then I bumped Angular 2 to RC.6 and got this error:

jan@linux-zd16:~/src/fm-repos/foo> ng serve
ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:26:45 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:27:49 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:28:49 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:46:38 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:50:47 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives/select_multiple_control_value_accessor.d.ts:12:17 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/form_providers.d.ts:13:37 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/form_providers.d.ts:18:46 
Generic type 'Type<T>' requires 1 type argument(s).
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks       Chunk Names
    index.html  2.81 kB       0       
webpack: bundle is now VALID.

Any ideas how to fix that? Here's my package.json:

{   "name": "foo", "version": "0.0.0", "license": "MIT",   
    "angular-cli": {},
    "scripts": {
      "start": "ng serve",
      "lint": "tslint \"src/**/*.ts\"",
      "test": "ng test",
      "pree2e": "webdriver-manager update",
      "e2e": "protractor"},
    "private": true,
"dependencies": {
    "@angular/common": "2.0.0-rc.6",
    "@angular/compiler": "2.0.0-rc.6",
    "@angular/core": "2.0.0-rc.6",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.6",
    "@angular/platform-browser": "2.0.0-rc.6",
    "@angular/platform-browser-dynamic": "2.0.0-rc.6",
    "@angular/router": "3.0.0-rc.2",
    "core-js": "^2.4.0",
    "rxjs": "5.0.0-beta.11",
    "ts-helpers": "^1.1.1",
    "zone.js": "0.6.12"},
"devDependencies": {
    "@types/jasmine": "^2.2.30",
    "angular-cli": "1.0.0-beta.11-webpack.8",
    "codelyzer": "~0.0.26",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "0.13.22",
    "karma-chrome-launcher": "0.2.3",
    "karma-jasmine": "0.3.8",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.3",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "2.0.0"}
}
like image 484
Jan Nielsen Avatar asked Sep 01 '16 18:09

Jan Nielsen


1 Answers

Update the @angular/form version to 2.0.0-rc.6. The version of Angular forms now matches the majority of other @angular module versions.

like image 140
Jan Nielsen Avatar answered Oct 16 '22 17:10

Jan Nielsen