Ionic run android | Supplied parameters do not match any signature of call target

Since rc0 a weird error is happening when running for android.

My HTML

Add Weather
<ion-item>
  <ion-label fixed>City</ion-label>
  <ion-input type="text" [(ngModel)]='data.city'></ion-input>
</ion-item>

<ion-item>
  <ion-label>Country</ion-label>
  <ion-select [(ngModel)]='data.country'>
    <ion-option value="uk">United Kingdom</ion-option>
    <ion-option value="us">United States</ion-option>

  </ion-select>
</ion-item>
<button ion-button block (click)="dismiss(data)">
Add Weather
</button>

My typescript

import { Component } from ‘@angular/core’;
import { NavController, ViewController } from ‘ionic-angular’;

@Component({
selector: ‘page-add-page’,
templateUrl: ‘add-page.html’
})
export class AddPage {

public data: any = {
country: ‘pt’
}

constructor(public navCtrl: NavController,
public viewCtrl: ViewController) { }

dismiss(data) {

this.viewCtrl.dismiss(data);

}
}

I’m stuck on this error:

[18:01:30] ngc error: Error: Error at /Users/gpires/code/dayssun/.tmp/pages/add-page/add-page.ngfactory.ts:732:29: Supplied parameters do not match any signature of call target.
Error at /Users/gpires/code/dayssun/.tmp/pages/add-page/add-page.ngfactory.ts:757:29: Supplied parameters do not match any signature of call target.
at check (/Users/gpires/code/dayssun/node_modules/@angular/tsc-wrapped/src/tsc.js:31:15)
at Tsc.typeCheck (/Users/gpires/code/dayssun/node_modules/@angular/tsc-wrapped/src/tsc.js:86:9)
at /Users/gpires/code/dayssun/node_modules/@angular/tsc-wrapped/src/main.js:33:23
at process._tickCallback (internal/process/next_tick.js:103:7)
at Module.runMain (module.js:592:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

but running ionic serve everything runs well.

Any ideas?

Thanks

2 Likes

try to add your pages components to /src/app/app.module.ts in both ‘declarations’ and ‘entryComponents’

it’s there. thanks anyway Eddy.

It means somewhere in your code you are calling a function without using the parameters you listed for it. This also includes in the HTML templates. One way to fix this is by making your function parameters optional by adding a ? after the parameter name.

2 Likes

thanks that worked for me

Can you explain more the problem. I do not have this problem in Ionic Server.

So a click event trigger ion-item (click)=“goToExpertDetail(expert)”>

But this is wrap around in

{{expert.data.name}} ({{expert.data.role}})

{{expert.data.title}} | {{expert.data.company}}

{{expert.data.field}}

And experts is coming from an angularFire2 obsversable list.

I assume the function here:
goToExpertDetail(expert?):void {
if(expert) {
this.navCtrl.push(Expertdetail, {
expert: expert.data
});
}
}

did not receive the epxert vaule b/c of async?

Does that display properly in the view?

open file .tmp/pages/add-page/add-page.ngfactory.ts
goto line 732 … find which function name is mentioned there …

I had a similar error … problem was in the custom pipe function

…
transform(items: Array, args: any[]): any {
…

Solution
transform(items: Array, args**?**: any[]): any {

4 Likes

This is most likely the answer every one is looking for

I thought everything in .tmp was regenerated on build and therefore wouldn’t this change be required on each build?

Frankly I couldn’t see where I needed to make the change as code bears little resemblance to my typescript file.