Ionic 3: Ionic serve error - Cannot read property 'filter' of undefined


#1

I updated my package.json to Ionic 3.0.0 from Ionic 2.3.0 as informed here, run ionic serve and got the following error (that doesn’t help much :confused:):

[17:34:36]  ionic-app-scripts 1.3.0
[17:34:36]  watch started ...
[17:34:36]  build dev started ...
[17:34:36]  clean started ...
[17:34:36]  clean finished in less than 1 ms
[17:34:36]  copy started ...
[17:34:36]  transpile started ...
[17:34:44]  transpile finished in 8.45 s
[17:34:44]  preprocess started ...
[17:34:44]  deeplinks started ...
[17:34:45]  ionic-app-script task: "serve"
[17:34:45]  Error: Cannot read property 'filter' of undefined
Error: Cannot read property 'filter' of undefined
    at BuildError.Error (native)
    at new BuildError (D:\Projetos\99Freelas\99FreelasApp\node_modules\@ionic\ap
p-scripts\dist\util\errors.js:16:28)
    at D:\Projetos\99Freelas\99FreelasApp\node_modules\@ionic\app-scripts\dist\p
reprocess.js:17:21

npm ERR! Windows_NT 6.1.7601
...

My package.json:

"scripts": {
	"ionic:build": "ionic-app-scripts build",
	"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
	"@angular/common": "4.0.0",
	"@angular/compiler": "4.0.0",
	"@angular/compiler-cli": "4.0.0",
	"@angular/core": "4.0.0",
	"@angular/forms": "4.0.0",
	"@angular/http": "4.0.0",
	"@angular/platform-browser": "4.0.0",
	"@angular/platform-browser-dynamic": "4.0.0",
	"@ionic-native/clipboard": "3.4.2",
	"@ionic-native/core": "3.4.2",
	"@ionic-native/facebook": "^3.4.4",
	"@ionic-native/push": "^3.4.4",
	"@ionic-native/splash-screen": "3.4.2",
	"@ionic-native/status-bar": "3.4.2",
	"@ionic/storage": "2.0.1",
	"@ngx-translate/core": "^6.0.1",
	"@ngx-translate/http-loader": "0.0.3",
	"@types/socket.io": "^1.4.27",
	"@types/socket.io-client": "^1.4.29",
	"ionic-angular": "3.0.0",
	"ionicons": "3.0.0",
	"rxjs": "5.1.1",
	"socket.io-client": "^1.7.1",
	"sw-toolbox": "3.4.0",
	"zone.js": "^0.8.4"
},
"devDependencies": {
	"@ionic/app-scripts": "1.3.0",
	"typescript": "~2.2.1"
},
"cordovaPlugins": [
	"cordova-plugin-device",
	"cordova-plugin-console",
	"cordova-plugin-whitelist",
	"cordova-plugin-splashscreen",
	"cordova-plugin-statusbar",
	"ionic-plugin-keyboard"
],

Ionic info:

Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 3.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v4.4.7
Xcode version: Not installed

Any thoughts about this?

If I run ionic build android --prod I also get the same error.

If I can’t resolve this issue I see no other alternative then revert all changes I made and use Ionic 2.3.0.


#2

Please share your app.module.ts.


#3

Same problem here.
Last night was ok… This morning, without any change, got that error when running…

News?!


#4

I’ve created a blank app and, based on it, changed my app app.component.ts to:

import { Component } from '@angular/core';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { Platform } from 'ionic-angular';

@Component({
	selector: 'nnf-app',
	template: '<div>Test</div>',
})
export class MyApp {

	constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
		platform.ready().then(() => {
			// Okay, so the platform is ready and our plugins are available.
			// Here you can do any higher level native things you might need.
			statusBar.styleDefault();
			splashScreen.hide();
		});
	}
}

And my app.module.ts to:

import { MyApp } from './app.component';
import { ErrorHandler, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';

@NgModule({
  declarations: [
    MyApp,
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

And the app executed successfully (ionic serve run till the end, without errors, and the initial page displayed Test).

I still haven’t found the cause of the issue, but now I think I can isolate and find the problem.


#5

Well, idk…
Same project, with no changes, sometimes works, sometimes not…
Very frustrating. :sweat:


#6

I solved my problem changing the AppModule that was like:

import { BusinessModule } from '../business/business.module';
import { ExternalModule } from '../external/external.module';
import { SimpleModule } from '../simple/simple.module';
import { MyApp } from './app.component';
import { ErrorHandler, NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';

const IONIC_CONFIG = {
	platforms: {
		android: {
			tabsPlacement: 'top',
		},
		core: {
			tabsPlacement: 'top',
		}
	}
};

const MODULES: Array<any> = [
	BrowserModule,
	HttpModule,
	IonicModule.forRoot(MyApp, IONIC_CONFIG),
	ExternalModule.forRoot(),
	SimpleModule.forRoot(),
	BusinessModule.forRoot(),
];

const PAGES: Array<any> = [
	MyApp
];

const BOOTSTRAP = [IonicApp];
const DECLARATIONS = PAGES;
const IMPORTS = MODULES;
const ENTRY_COMPONENTS = PAGES;

@NgModule({
	bootstrap: BOOTSTRAP,
	declarations: DECLARATIONS,
	imports: IMPORTS,
	entryComponents: ENTRY_COMPONENTS,
	providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
})
export class AppModule {
	constructor() { }
}

to:

import { BusinessModule } from '../business/business.module';
import { ExternalModule } from '../external/external.module';
import { SimpleModule } from '../simple/simple.module';
import { MyApp } from './app.component';
import { ErrorHandler, NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { BrowserModule } from '@angular/platform-browser';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';

const IONIC_CONFIG = {
	platforms: {
		android: {
			tabsPlacement: 'top',
		},
		core: {
			tabsPlacement: 'top',
		}
	}
};

@NgModule({
  declarations: [
    MyApp,
  ],
  imports: [
    BrowserModule,
	HttpModule,
    IonicModule.forRoot(MyApp, IONIC_CONFIG),
	ExternalModule.forRoot(),
	SimpleModule.forRoot(),
	BusinessModule.forRoot(),
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
  ],
  providers: [
    { provide: ErrorHandler, useClass: IonicErrorHandler }
  ]
})
export class AppModule {}

I used constants to store the declarations, providers, etc…, to avoid having to duplicate code.

Before it worked even with AOT, but probably some changes regarding the module handling by Ionic or Angular changed and caused those errors.

I’ve changed my other modules too, as precaution (but the ionic serve error occured only because of AppModule).


#7

Wow… i hate that.

I did this too and now is working well…

NOT WORKING

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpModule } from '@angular/http';
import { NgModule, ErrorHandler } from '@angular/core';

import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';

// @ionic-native
import { BarcodeScanner } from '@ionic-native/barcode-scanner';
import { Camera } from '@ionic-native/camera';
import { Facebook } from '@ionic-native/facebook';
import { Network } from '@ionic-native/network';
import { GooglePlus } from '@ionic-native/google-plus';
import { SocialSharing } from '@ionic-native/social-sharing';
import { SplashScreen } from '@ionic-native/splash-screen';
import { SQLite } from '@ionic-native/sqlite';
import { StatusBar } from '@ionic-native/status-bar';

// app di base
import { AreteCustomer } from './app.component';

// Lista Spesa - Dettaglio Lista Articoli
import { Lista } from '../pages/lista/lista';
import { ListaModalImportoListeArticoli } from '../pages/lista-modal-importo-liste-articoli/lista-modal-importo-liste-articoli'
import { ListaPopoverColore } from '../pages/lista-popover-colore/lista-popover-colore';
import { ListaPopoverImg } from '../pages/lista-popover-img/lista-popover-img';
import { ListaPopoverMenu } from '../pages/lista-popover-menu/lista-popover-menu';
import { ListaPopoverOrdinamento } from '../pages/lista-popover-ordinamento/lista-popover-ordinamento';
import { ListaPopoverQuantita } from '../pages/lista-popover-quantita/lista-popover-quantita';

// Liste Articoli
import { ListeArticoli } from '../pages/liste-articoli/liste-articoli';
import { ListeArticoliModalEditor } from '../pages/liste-articoli-modal-editor/liste-articoli-modal-editor';
import { ListeArticoliModalEditorPopoverImg } from '../pages/liste-articoli-modal-editor-popover-img/liste-articoli-modal-editor-popover-img';
import { ListeArticoliPopoverMenu } from '../pages/liste-articoli-popover-menu/liste-articoli-popover-menu';

// Impostazioni
import { Impostazioni } from '../pages/impostazioni/impostazioni';
import { ImpostazioniProfilo } from '../pages/impostazioni-profilo/impostazioni-profilo';
import { ImpostazioniSincronizzazione } from '../pages/impostazioni-sincronizzazione/impostazioni-sincronizzazione';

// Login
import { Login } from '../pages/login/login';

// Ricettario
import { Ricettario } from '../pages/ricettario/ricettario';
import { RicettarioDettaglioPiatto } from '../pages/ricettario-dettaglio-piatto/ricettario-dettaglio-piatto';
import { RicettarioPopoverMenu } from '../pages/ricettario-popover-menu/ricettario-popover-menu';

// Saldi
import { Saldi } from '../pages/saldi/saldi';
import { SaldiGoduto } from '../pages/saldi-goduto/saldi-goduto';
import { SaldiMaturato } from '../pages/saldi-maturato/saldi-maturato';

// Self Scan
import { SelfScan } from '../pages/self-scan/self-scan';
import { SelfScanPaymentBarcode } from '../pages/self-scan-payment-barcode/self-scan-payment-barcode';

// Miscellanea
import { Categorie } from '../pages/categorie/categorie';
import { CategorieArticoli } from '../pages/categorie-articoli/categorie-articoli';
import { DettaglioReferenza } from '../pages/dettaglio-referenza/dettaglio-referenza';
import { Preferiti } from '../pages/preferiti/preferiti';
import { Ricerca } from '../pages/ricerca/ricerca';
import { Scontrino } from '../pages/scontrino/scontrino';
import { ScontrinoDettaglio } from '../pages/scontrino-dettaglio/scontrino-dettaglio';
import { Tutorial } from '../pages/tutorial/tutorial';
import { ZoomImg } from '../pages/zoom-img/zoom-img';

// Pipe
import { CategoriaRicettaPipe } from '../pipes/categoria-ricetta-pipe';
import { MomentPipe } from '../pipes/moment-pipe';
import { ReferenzaRicettaPipe } from '../pipes/referenza-ricetta-pipe';

// Providers
import { SqlStorage } from '../providers/sql-storage';

import { AggiornaListaEcommProvider } from '../providers/aggiorna-lista-ecomm-provider';
import { RicercaArticoliProvider } from '../providers/ricerca-articoli-provider';
import { BarcodeProvider } from '../providers/barcode-provider';
import { CategorieProvider } from '../providers/categorie-provider';
import { CategorieArticoliProvider } from '../providers/categorie-articoli-provider';
import { DettaglioReferenzaProvider } from '../providers/dettaglio-referenza-provider';
import { DizionarioProvider } from '../providers/dizionario-provider';
import { GestionePreferitiProvider } from '../providers/gestione-preferiti-provider';
import { InserisciOrdineEcommProvider } from '../providers/inserisci-ordine-ecomm-provider';
import { MovimentiGodutoProvider } from '../providers/movimenti-goduto-provider';
import { MovimentiMaturatoProvider } from '../providers/movimenti-maturato-provider';
import { PreferitiProvider } from '../providers/preferiti-provider';
import { RicetteProvider } from '../providers/ricette-provider';
import { RipulisciListaEcommProvider } from '../providers/ripulisci-lista-ecomm-provider';
import { SaldiProvider } from '../providers/saldi-provider';
import { ScontrinoProvider } from '../providers/scontrino-provider';
import { ScontrinoDettaglioProvider } from '../providers/scontrino-dettaglio-provider';

// The IonicNative array lists all of the ionic native plugin we want to use in our app. As you add and remove plugins, make sure to keep this list up to date.
let ionicNative = [
    BarcodeScanner,
    Camera,
    Facebook,
    Network,
    GooglePlus,
    SocialSharing,
    SplashScreen,
    SQLite,
    StatusBar
];

// The Pages array lists all of the pages we want to use in our app. As you add and remove pages, make sure to keep this list up to date.
let pages = [
    AreteCustomer,

    Lista, ListaModalImportoListeArticoli, ListaPopoverColore, ListaPopoverImg, ListaPopoverMenu, ListaPopoverOrdinamento, ListaPopoverQuantita,
    ListeArticoli, ListeArticoliModalEditor, ListeArticoliModalEditorPopoverImg, ListeArticoliPopoverMenu,
    Impostazioni, ImpostazioniProfilo, ImpostazioniSincronizzazione,
    Login,
    Ricettario, RicettarioDettaglioPiatto, RicettarioPopoverMenu,
    Saldi, SaldiGoduto, SaldiMaturato,
    SelfScan, SelfScanPaymentBarcode,
    Categorie, CategorieArticoli, DettaglioReferenza, Preferiti, Ricerca, Scontrino, ScontrinoDettaglio, Tutorial, ZoomImg
];

//The Pipes array lists all of the pipes we want to use in our app. As you add and remove pipes, make sure to keep this list up to date.
let pipes = [
    CategoriaRicettaPipe,
    MomentPipe,
    ReferenzaRicettaPipe
];

// The Providers array lists all of the providers we want to use in our app. As you add and remove providers, make sure to keep this list up to date.
let providers = [
    SqlStorage,

    AggiornaListaEcommProvider,
    BarcodeProvider,
    CategorieProvider,
    CategorieArticoliProvider,
    DettaglioReferenzaProvider,
    DizionarioProvider,
    GestionePreferitiProvider,
    InserisciOrdineEcommProvider,
    MovimentiGodutoProvider,
    MovimentiMaturatoProvider,
    PreferitiProvider,
    RicercaArticoliProvider,
    RicetteProvider,
    RipulisciListaEcommProvider,
    SaldiProvider,
    ScontrinoProvider,
    ScontrinoDettaglioProvider
];

export function getDeclarations() {
    return [
        pages,
        pipes
    ];
}

export function getImports() {
    return [
        BrowserModule,
        BrowserAnimationsModule,
        HttpModule,
        IonicModule.forRoot(AreteCustomer)
    ];
}

export function getEntryComponents() {
    return pages;
}

export function getProviders() {
    return [
        { provide: ErrorHandler, useClass: IonicErrorHandler },
        providers,
        ionicNative
    ];
}

@NgModule({
    declarations: getDeclarations(),
    imports: getImports(),
    bootstrap: [IonicApp],
    entryComponents: getEntryComponents(),
    providers: getProviders()
})
export class AppModule {}

WORKING

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpModule } from '@angular/http';
import { NgModule, ErrorHandler } from '@angular/core';

import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';

// @ionic-native
import { BarcodeScanner } from '@ionic-native/barcode-scanner';
import { Camera } from '@ionic-native/camera';
import { Facebook } from '@ionic-native/facebook';
import { Network } from '@ionic-native/network';
import { GooglePlus } from '@ionic-native/google-plus';
import { SocialSharing } from '@ionic-native/social-sharing';
import { SplashScreen } from '@ionic-native/splash-screen';
import { SQLite } from '@ionic-native/sqlite';
import { StatusBar } from '@ionic-native/status-bar';

// app di base
import { AreteCustomer } from './app.component';

// Lista Spesa - Dettaglio Lista Articoli
import { Lista } from '../pages/lista/lista';
import { ListaModalImportoListeArticoli } from '../pages/lista-modal-importo-liste-articoli/lista-modal-importo-liste-articoli'
import { ListaPopoverColore } from '../pages/lista-popover-colore/lista-popover-colore';
import { ListaPopoverImg } from '../pages/lista-popover-img/lista-popover-img';
import { ListaPopoverMenu } from '../pages/lista-popover-menu/lista-popover-menu';
import { ListaPopoverOrdinamento } from '../pages/lista-popover-ordinamento/lista-popover-ordinamento';
import { ListaPopoverQuantita } from '../pages/lista-popover-quantita/lista-popover-quantita';

// Liste Articoli
import { ListeArticoli } from '../pages/liste-articoli/liste-articoli';
import { ListeArticoliModalEditor } from '../pages/liste-articoli-modal-editor/liste-articoli-modal-editor';
import { ListeArticoliModalEditorPopoverImg } from '../pages/liste-articoli-modal-editor-popover-img/liste-articoli-modal-editor-popover-img';
import { ListeArticoliPopoverMenu } from '../pages/liste-articoli-popover-menu/liste-articoli-popover-menu';

// Impostazioni
import { Impostazioni } from '../pages/impostazioni/impostazioni';
import { ImpostazioniProfilo } from '../pages/impostazioni-profilo/impostazioni-profilo';
import { ImpostazioniSincronizzazione } from '../pages/impostazioni-sincronizzazione/impostazioni-sincronizzazione';

// Login
import { Login } from '../pages/login/login';

// Ricettario
import { Ricettario } from '../pages/ricettario/ricettario';
import { RicettarioDettaglioPiatto } from '../pages/ricettario-dettaglio-piatto/ricettario-dettaglio-piatto';
import { RicettarioPopoverMenu } from '../pages/ricettario-popover-menu/ricettario-popover-menu';

// Saldi
import { Saldi } from '../pages/saldi/saldi';
import { SaldiGoduto } from '../pages/saldi-goduto/saldi-goduto';
import { SaldiMaturato } from '../pages/saldi-maturato/saldi-maturato';

// Self Scan
import { SelfScan } from '../pages/self-scan/self-scan';
import { SelfScanPaymentBarcode } from '../pages/self-scan-payment-barcode/self-scan-payment-barcode';

// Miscellanea
import { Categorie } from '../pages/categorie/categorie';
import { CategorieArticoli } from '../pages/categorie-articoli/categorie-articoli';
import { DettaglioReferenza } from '../pages/dettaglio-referenza/dettaglio-referenza';
import { Preferiti } from '../pages/preferiti/preferiti';
import { Ricerca } from '../pages/ricerca/ricerca';
import { Scontrino } from '../pages/scontrino/scontrino';
import { ScontrinoDettaglio } from '../pages/scontrino-dettaglio/scontrino-dettaglio';
import { Tutorial } from '../pages/tutorial/tutorial';
import { ZoomImg } from '../pages/zoom-img/zoom-img';

// Pipe
import { CategoriaRicettaPipe } from '../pipes/categoria-ricetta-pipe';
import { MomentPipe } from '../pipes/moment-pipe';
import { ReferenzaRicettaPipe } from '../pipes/referenza-ricetta-pipe';

// Providers
import { SqlStorage } from '../providers/sql-storage';

import { AggiornaListaEcommProvider } from '../providers/aggiorna-lista-ecomm-provider';
import { RicercaArticoliProvider } from '../providers/ricerca-articoli-provider';
import { BarcodeProvider } from '../providers/barcode-provider';
import { CategorieProvider } from '../providers/categorie-provider';
import { CategorieArticoliProvider } from '../providers/categorie-articoli-provider';
import { DettaglioReferenzaProvider } from '../providers/dettaglio-referenza-provider';
import { DizionarioProvider } from '../providers/dizionario-provider';
import { GestionePreferitiProvider } from '../providers/gestione-preferiti-provider';
import { InserisciOrdineEcommProvider } from '../providers/inserisci-ordine-ecomm-provider';
import { MovimentiGodutoProvider } from '../providers/movimenti-goduto-provider';
import { MovimentiMaturatoProvider } from '../providers/movimenti-maturato-provider';
import { PreferitiProvider } from '../providers/preferiti-provider';
import { RicetteProvider } from '../providers/ricette-provider';
import { RipulisciListaEcommProvider } from '../providers/ripulisci-lista-ecomm-provider';
import { SaldiProvider } from '../providers/saldi-provider';
import { ScontrinoProvider } from '../providers/scontrino-provider';
import { ScontrinoDettaglioProvider } from '../providers/scontrino-dettaglio-provider';

@NgModule({
    declarations: [
        AreteCustomer,

        // pagine
        Lista, ListaModalImportoListeArticoli, ListaPopoverColore, ListaPopoverImg, ListaPopoverMenu, ListaPopoverOrdinamento, ListaPopoverQuantita,
        ListeArticoli, ListeArticoliModalEditor, ListeArticoliModalEditorPopoverImg, ListeArticoliPopoverMenu,
        Impostazioni, ImpostazioniProfilo, ImpostazioniSincronizzazione,
        Login,
        Ricettario, RicettarioDettaglioPiatto, RicettarioPopoverMenu,
        Saldi, SaldiGoduto, SaldiMaturato,
        SelfScan, SelfScanPaymentBarcode,
        Categorie, CategorieArticoli, DettaglioReferenza, Preferiti, Ricerca, Scontrino, ScontrinoDettaglio, Tutorial, ZoomImg,

        // pipe
        CategoriaRicettaPipe,
        MomentPipe,
        ReferenzaRicettaPipe
    ],
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        HttpModule,
        IonicModule.forRoot(AreteCustomer)
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        AreteCustomer,

        Lista, ListaModalImportoListeArticoli, ListaPopoverColore, ListaPopoverImg, ListaPopoverMenu, ListaPopoverOrdinamento, ListaPopoverQuantita,
        ListeArticoli, ListeArticoliModalEditor, ListeArticoliModalEditorPopoverImg, ListeArticoliPopoverMenu,
        Impostazioni, ImpostazioniProfilo, ImpostazioniSincronizzazione,
        Login,
        Ricettario, RicettarioDettaglioPiatto, RicettarioPopoverMenu,
        Saldi, SaldiGoduto, SaldiMaturato,
        SelfScan, SelfScanPaymentBarcode,
        Categorie, CategorieArticoli, DettaglioReferenza, Preferiti, Ricerca, Scontrino, ScontrinoDettaglio, Tutorial, ZoomImg
    ],
    providers: [
        SqlStorage,

        AggiornaListaEcommProvider,
        BarcodeProvider,
        CategorieProvider,
        CategorieArticoliProvider,
        DettaglioReferenzaProvider,
        DizionarioProvider,
        GestionePreferitiProvider,
        InserisciOrdineEcommProvider,
        MovimentiGodutoProvider,
        MovimentiMaturatoProvider,
        PreferitiProvider,
        RicercaArticoliProvider,
        RicetteProvider,
        RipulisciListaEcommProvider,
        SaldiProvider,
        ScontrinoProvider,
        ScontrinoDettaglioProvider,

        // ionic native
        BarcodeScanner,
        Camera,
        Facebook,
        Network,
        GooglePlus,
        SocialSharing,
        SplashScreen,
        SQLite,
        StatusBar,

        {provide: ErrorHandler, useClass: IonicErrorHandler}
    ]
})
export class AppModule {}

Waste soooo much time for nothing… THX @lucasbasquerotto

I’d like to know why old code does not work… :rage:


#8

I believe the fundamental issue is the munging that app-scripts does for managing building both with and without ngc off the same code base. It is pretty particular about how app.module.ts is structured, and in my experience it is best not to try to get too cute about modifying it.


#9

One thing that seems to be working for me is utilizing the spread ... operator, e.g:

let pages = [ 
   AwesomePage1,
   AwesomePage2,
   LamePage1
];

@NgModule({
   declarations: [
      ...pages
   ],
   OTHER STUFF,
   entryComponents: [
      ...pages
   ]
})

YMMV, of course.


#10

Strange operator, really.
I can not understand the use. :joy:

… But it works! :grin:


#11

Hi everyone,

I just updated to ionic 3 and after that i tried to run ionic serve on my project and i get the following error “AppScripts.serve is not a function” :

$ ionic serve -lc
? Looks like this is an Ionic Angular project, would you like to install @ionic/cli-plugin-ionic-angular and continue? Yes
> npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
✔ Running command - done!

$ ionic serve
Starting app-scripts server: --port 8100 --livereload-port 35729 --address 0.0.0.0 - Ctrl+C to cancel
TypeError: AppScripts.serve is not a function

Anyone have an idea ?

[EDIT] i found the solution, just running :

      npm install --save-dev @ionic/app-scripts@latest

thanks