Проект Ionic 2 прекрасно работает в браузере, но не будет построен для IOS

Надеюсь, кто-то может помочь, вытащив мои волосы на этом немного.

Я разрабатываю приложение Ionic 2 с Firebase 3 backend. Он отлично работает при локальном тестировании в браузере, т. е. при выполнении команды:

ionic serve

У меня не было никаких проблем с получением его на моем устройстве IOS ранее, однако теперь я постоянно получаю следующую ошибку, когда я пытаюсь построить:

myIonicFFApp $ ionic build ios

Running 'build:before' npm script before build

> Feetfirst@ build /Users/alan/Desktop/myIonicFFApp

> ionic-app-scripts build

[10:38:00]  ionic-app-scripts 0.0.37 

[10:38:00]  build prod started ... 

[10:38:00]  clean started ... 

[10:38:00]  clean finished in 3 ms 
[10:38:00]  copy started ... 
[10:38:00]  ngc started ... 
[10:38:01]  copy finished in 109 ms 
[10:38:01]  lint started ... 
[10:38:03]  lint finished in 1.90 s 
[10:38:13]  Error: Error at /Users/alan/Desktop/myIonicFFApp/.tmp/pages/infant-create/infant-create.ngfactory.ts:437:40 

[10:38:13]  Property 'infantName' does not exist on type 'InfantCreatePage'. 
[10:38:13]  Error at /Users/alan/Desktop/myIonicFFApp/.tmp/pages/infant-create/infant-create.ngfactory.ts:467:41 
[10:38:13]  Property 'infantDate' does not exist on type 'InfantCreatePage'. 
[10:38:13]  Error at /Users/alan/Desktop/myIonicFFApp/.tmp/pages/infant-create/infant-create.ngfactory.ts:603:43 
[10:38:13]  Property 'infantName' does not exist on type 'InfantCreatePage'. 
[10:38:13]  Error at /Users/alan/Desktop/myIonicFFApp/.tmp/pages/infant-create/infant-create.ngfactory.ts:608:43 

[10:38:13]  Property 'infantDate' does not exist on type 'InfantCreatePage'. 

[10:38:13]  Error at /Users/alan/Desktop/myIonicFFApp/.tmp/pages/infant-create/infant-create.ngfactory.ts:623:68 
[10:38:13]  Property 'infantName' does not exist on type 'InfantCreatePage'. 

[10:38:13]  Error at /Users/alan/Desktop/myIonicFFApp/.tmp/pages/infant-create/infant-create.ngfactory.ts:623:92 
[10:38:13]  Property 'infantDate' does not exist on type 'InfantCreatePage'. 

[10:38:13]  ngc failed 

[10:38:13]  ionic-app-script task: "build" 

[10:38:13]  Error: Error 



npm ERR! Darwin 16.0.0

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v4.4.5
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! Feetfirst@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 

npm ERR! Failed at the Feetfirst@ 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 Feetfirst     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 Feetfirst
npm ERR!  Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls Feetfirst
npm ERR!  There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/alan/Desktop/myIonicFFApp/npm-debug.log

Caught exception:
 undefined 

Есть идеи, чем это может быть вызвано?

Below is my: infant-create.ts


import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { InfantData } from '../../providers/infant-data';

@Component({
  selector: 'page-infant-create',
  templateUrl: 'infant-create.html',
})
export class InfantCreatePage {
  public nav: NavController; // <- Declare the property explicitly.
  public infantData: InfantData; // <- Declare the property explicitly.

constructor( nav: NavController, infantData: InfantData) {
this.nav = nav;
this.infantData = infantData;
  }

  createInfant(infantName: string, infantDate: string) {
    this.infantData.createInfant(infantName, infantDate).then( () => {
      this.nav.pop();
    });
  }

}

который ссылается на младенческие данные.ts:

import { Injectable } from '@angular/core';
import firebase from 'firebase';

@Injectable()
export class InfantData {
  public currentUser: any;
  public infantList: any;
  public profilePictureRef: any;

 constructor() {
  this.currentUser = firebase.auth().currentUser.uid;
  this.infantList = firebase.database().ref('userProfile/' + this.currentUser + '/infantList');
this.profilePictureRef = firebase.storage().ref('/guestProfile/');

}

  getInfantList(): any {
return this.infantList;
}

getInfantDetail(infantId): any {
  return this.infantList.child(infantId);
}

createInfant(infantName: string, infantDate: string): any {
return this.infantList.push({
  name: infantName,
  date: infantDate
}).then( newInfant => {
  this.infantList.child(newInfant.key).child('id').set(newInfant.key);
});
}



}

1 ответ

  1. Вы пробовали явно объявить функцию createInfant?

     public createInfant(infantName: string, infantDate: string) {
        this.infantData.createInfant(infantName, infantDate).then( () => {
          this.nav.pop();
        });
      }