Ionic build ios: Supplied parameters do not match any signature of call target


#1

I’m attempting a ionic build ios command, but it fails on my login form page. Can anyone point out where I’m going wrong (this is my first ionic2 app!):

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.36
ios-deploy version: 1.9.0
ios-sim version: 5.0.10
OS: Mac OS X Sierra
Node Version: v7.0.0
Xcode version: Xcode 8.1 Build version 8B62

➜  myApp ionic build ios

Running 'build:before' npm script before build

> myApp@ build /Users/tom/Documents/myApp
> ionic-app-scripts build

[09:58:21]  ionic-app-scripts 0.0.36
[09:58:21]  build prod started ...
[09:58:21]  clean started ...
[09:58:21]  clean finished in 4 ms
[09:58:21]  copy started ...
[09:58:21]  ngc started ...
[09:58:21]  copy finished in 41 ms
[09:58:21]  lint started ...
[09:58:22]  lint finished in 1.05 s
[09:58:30]  Error: Error at /Users/tom/Documents/myApp/.tmp/pages/login/login.ngfactory.ts:626:29
[09:58:30]  Supplied parameters do not match any signature of call target.
[09:58:30]  ngc failed
[09:58:30]  ionic-app-script task: "build"
[09:58:30]  Error: Error

npm ERR! Darwin 16.1.0
npm ERR! argv "/Users/tom/.nvm/versions/node/v7.0.0/bin/node" "/Users/tom/.nvm/versions/node/v7.0.0/bin/npm" "run" "build"
npm ERR! node v7.0.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! myApp@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myApp@ build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the myApp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs myApp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls myApp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tom/Documents/myApp/npm-debug.log
Caught exception:
 undefined

Here’s the code for the login.ts:

import { Component } from '@angular/core';
import { LoginService } from '../../providers/login.service';
import { FormBuilder, Validators } from '@angular/forms';

@Component({
  selector: 'page-login',
  templateUrl: 'login.html'
})
export class LoginPage {
  loginForm: any;
  constructor(private loginSrv: LoginService, public formBuilder: FormBuilder) {}

  ionViewDidLoad() {
    console.log('Login Page Loaded');
	  this.loginForm = this.formBuilder.group({
		  email: ['', Validators.required],
		  password: ['', Validators.required]
    });
  }

  onLogin(loginForm) {
  	console.log("Login Form submitted");
  	this.loginSrv.authenticate(this.loginForm);
  }

} 

EDIT: Adding Template:

<ion-header>
  <ion-navbar>
    <ion-title>
      Login
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
	
	<form [formGroup]="loginForm" (ngSubmit)="onLogin()">
	<ion-item>
		<ion-label stacked>Email address</ion-label>
		<ion-input type="email" formControlName="email"></ion-input>
	</ion-item>
	<ion-item>
		<ion-label stacked>Password</ion-label>
		<ion-input type="password" formControlName="password"></ion-input>
	</ion-item>

	<button ion-button type="submit" [disabled]="!loginForm.valid">Submit</button>
</form>

</ion-content>

Thanks!


#2

Can you post the template? Could it be the onLogin gets called with <> 1 arguments?


#3

Updated post with template!


#4

The errors states that the call signature does not match the supplied parameters. The method onLogin expects the form, which you don’t supply. I think you can remove the parameter from the function and access the form directly


#5

Agh! So simple, yet I was blind to it :slight_smile:
Thanks so much, that’s compiling now!