Can't resolve all parameters for Pro: (?, ?)

Hi all,

I’m trying to integrate the Ionic Pro error monitoring in my app but I’m facing this problem.

Error: Can't resolve all parameters for Pro: (?, ?).
    at syntaxError (http://localhost:8100/build/vendor.js:92160:34)
    at CompileMetadataResolver._getDependenciesMetadata (http://localhost:8100/build/vendor.js:105497:35)
    at CompileMetadataResolver._getTypeMetadata (http://localhost:8100/build/vendor.js:105365:26)
    at CompileMetadataResolver._getInjectableMetadata (http://localhost:8100/build/vendor.js:105351:21)
    at CompileMetadataResolver.getProviderMetadata (http://localhost:8100/build/vendor.js:105641:40)
    at http://localhost:8100/build/vendor.js:105570:49
    at Array.forEach (<anonymous>)
    at CompileMetadataResolver._getProvidersMetadata (http://localhost:8100/build/vendor.js:105531:19)
    at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/vendor.js:105186:50)
    at JitCompiler._loadModules (http://localhost:8100/build/vendor.js:116250:66)

My source (app.module.ts)

// Ionic
import { Pro } from '@ionic/pro';
import { BrowserModule } from "@angular/platform-browser";
import { ErrorHandler, Injectable, Injector, NgModule } from "@angular/core";
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { IonicApp, IonicErrorHandler, IonicModule } from "ionic-angular";
import { IonicStorageModule } from '@ionic/storage';
import { ABK } from "./app.component";


// Globals
import { HttpModule } from "@angular/http";
import { Camera } from "@ionic-native/camera";
import { GlobalUrl } from "../assets/url/url";
import { FormValidator } from '../providers/handlers/form-validator';
import { FabToolbar } from '../directives/fab-toolbar/fab-toolbar';
import { Device } from '@ionic-native/device';
import { StatusBar } from "@ionic-native/status-bar";
import { SplashScreen } from "@ionic-native/splash-screen";
import { Network } from '@ionic-native/network';
import { OneSignal } from '@ionic-native/onesignal';
import { TooltipsModule } from 'ionic-tooltips';
import { Diagnostic } from '@ionic-native/diagnostic';
import { AndroidPermissions } from '@ionic-native/android-permissions';
import { SQLite, SQLiteObject } from '@ionic-native/sqlite';


// Pagina's
// -> Common
import { Form } from "../pages/form/form";

// -> Authentication
import { AuthenticationLoginPage } from "../pages/authentication/login/login";
import { AuthenticationAuthPage } from "../pages/authentication/auth/auth";
import { AuthenticationVerificationPage } from "../pages/authentication/verification/verification";
import { AuthenticationAccountsPage } from "../pages/authentication/accounts/accounts";
import { AuthenticationAccountsAddPage } from "../pages/authentication/accounts/accounts-add/accounts-add";

// -> Inventarisatie
import { InventarisatieProjectenPage } from "../pages/inventarisatie/projecten/projecten";
import { InventarisatieHousesPage } from "../pages/inventarisatie/houses/houses";
import { InventarisatieHousePage } from "../pages/inventarisatie/house/house";
import { InventarisatieStreetsPage } from "../pages/inventarisatie/streets/streets";
import { InventarisatieCreateStreetPage } from "../pages/inventarisatie/streets/create-street/create-street";
import { InventarisatiePageStreetEdit } from "../pages/inventarisatie/streets/edit-street/edit-street";
import { InventarisatieCreateHousenumberPage } from "../pages/inventarisatie/houses/create-housenumber/create-housenumber";
import { InventarisatieRoomPage } from "../pages/inventarisatie/room/room";
import { InventarisatieCreateRoomPage } from "../pages/inventarisatie/room/create-room/create-room";
import { InventarisatiePhotoPage } from "../pages/inventarisatie/photo/photo";
import { InventarisatieCreatePhotoPage } from "../pages/inventarisatie/photo/create-photo/create-photo";


// -> Renovatie
import { RenovatieProjectenPage } from "../pages/renovatie/projecten/projecten";
import { RenovatieStreetsPage } from "../pages/renovatie/streets/streets";
import { RenovatieHousesPage} from "../pages/renovatie/houses/houses";
import { RenovatieHousePage } from "../pages/renovatie/house/house";
import { RenovatieRoomPage } from "../pages/renovatie/room/room";


// -> General
import { GeneralOptionsPage } from "../pages/general/options/options";


// -> Modals
import { ImageModal } from "../pages/modals/image/image";
import { ElementsModal } from "../pages/modals/elements/elements";
import { NoteModal } from "../pages/modals/note/note";
import { ManurenModal } from "../pages/modals/manuren/manuren";


// Providers
import { AuthService } from "../providers/auth-service/auth-service";
import { Handlers } from "../providers/handlers/handlers";
import { LocalstorageProvider } from '../providers/localstorage/localstorage';
import { LoggerProvider } from '../providers/logger/logger';
import { CallsProvider } from '../providers/calls/calls';

const IonicPro = Pro.init('HERE_IS_MY_APP_ID', {
    appVersion: "1.0"
});


/**
 * Export class voor Ionic Pro error handling
 */
@Injectable()
export class MyErrorHandler implements ErrorHandler {
  ionicErrorHandler: IonicErrorHandler;

  constructor(injector: Injector) {
    try {
      this.ionicErrorHandler = injector.get(IonicErrorHandler);
    } catch(e) {
      // Unable to get the IonicErrorHandler provider, ensure
    }
  }

  handleError(err: any): void {
    IonicPro.monitoring.handleNewError(err);
    // Remove this if you want to disable Ionic's auto exception handling
    // in development mode.
    this.ionicErrorHandler && this.ionicErrorHandler.handleError(err);
  }
}


@NgModule({
    declarations: [
        ABK,
        // Authentication
        AuthenticationAuthPage,
        AuthenticationLoginPage,
        AuthenticationVerificationPage,
        AuthenticationAccountsPage,
        AuthenticationAccountsAddPage,

        // Inventarisatie
        InventarisatieProjectenPage,
        InventarisatieHousesPage,
        InventarisatieHousePage,
        InventarisatieStreetsPage,
        InventarisatieCreateStreetPage,
        InventarisatiePageStreetEdit,
        InventarisatieCreateHousenumberPage,
        InventarisatieRoomPage,
        InventarisatieCreateRoomPage,
        InventarisatiePhotoPage,
        InventarisatieCreatePhotoPage,

        // Renovatie
        RenovatieProjectenPage,
        RenovatieStreetsPage,
        RenovatieHousesPage,
        RenovatieHousePage,
        RenovatieRoomPage,

        // General
        GeneralOptionsPage,

        // Modals
        ImageModal,
        ElementsModal,
        NoteModal,
        ManurenModal,

        // Common
        Form,
        FabToolbar,
    ],
    imports: [
        BrowserModule,
        IonicModule.forRoot(ABK),
        HttpModule,
        IonicStorageModule.forRoot(),
        TooltipsModule,
        BrowserAnimationsModule,
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        ABK,
        // Authentication
        AuthenticationAuthPage,
        AuthenticationLoginPage,
        AuthenticationVerificationPage,
        AuthenticationAccountsPage,
        AuthenticationAccountsAddPage,

        // Inventarisatie
        InventarisatieProjectenPage,
        InventarisatieHousesPage,
        InventarisatieHousePage,
        InventarisatieStreetsPage,
        InventarisatieCreateStreetPage,
        InventarisatiePageStreetEdit,
        InventarisatieCreateHousenumberPage,
        InventarisatieRoomPage,
        InventarisatieCreateRoomPage,
        InventarisatiePhotoPage,
        InventarisatieCreatePhotoPage,

        // Renovatie
        RenovatieProjectenPage,
        RenovatieStreetsPage,
        RenovatieHousesPage,
        RenovatieHousePage,
        RenovatieRoomPage,

        // General
        GeneralOptionsPage,

        // Modals
        ImageModal,
        ElementsModal,
        NoteModal,
        ManurenModal,

        // Common
        Form,
        FabToolbar,
    ],
    providers: [
        StatusBar,
        SplashScreen,
        Device,
        OneSignal,
        AuthService,
        Camera,
        Pro,
        Handlers,
        GlobalUrl,
        Diagnostic,
        FormValidator,
        IonicErrorHandler,
        [{ provide: ErrorHandler, useClass: MyErrorHandler }],
        LocalstorageProvider,
        LoggerProvider,
        Network,
        CallsProvider,
        AndroidPermissions,
        SQLite,
    ]
})
export class AppModule
{
}

Ionic info

cli packages: (/home/thijmen/Desktop/abk/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.3.0 ios 4.5.2
    Ionic Framework    : ionic-angular 3.3.0

System:

    Node : v6.11.4
    npm  : 5.5.1 
    OS   : Linux 4.10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

I hope some one knows a solution for this. Can’t figure it out.

I’m still new to all of this and am not sure if this will help but I import Pro at the very end of all my imports and then am declaring the old Error Handler as shown in the second image. I couldn’t give you a reason why this might work but those are the only differences I see between your app.module.ts file and mine.

09 PM

29 PM

Have you found a solution for this? I am running into the same situation as we speak.

Remove Pro from providers.

Pro is not part of my providers list.

Can you post the relevant code? App.module.ts and / or the page that is causing the error?

I guess ‘Pro’ is not meant to be added as a provider, I removed it from NgModule providers in the app.module.ts file and the error disappeared.

Also add the app_Id and the documentation says the app version must adhere to semver.org (e.g. 1.0.0)