Prod build crashes with latest app-scripts [CLOSED]


#1

Hello, i have some problems with latest ionic ver.

it my package.json

{
    "name": "b2safe",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve",
        "docs": "typedoc --out ./docs ./src --ignoreCompilerErrors",
        "iosbuild": "ionic cordova build ios",
        "iosrun": "ionic cordova run ios",
        "mdbuild": "ionic cordova build android",
        "mdrun": "ionic cordova run android"
    },
    "dependencies": {
        "@angular/common": "5.0.0",
        "@angular/compiler": "5.0.0",
        "@angular/compiler-cli": "5.0.0",
        "@angular/core": "5.0.0",
        "@angular/forms": "5.0.0",
        "@angular/http": "5.0.0",
        "@angular/platform-browser": "5.0.0",
        "@angular/platform-browser-dynamic": "5.0.0",
        "@angular/tsc-wrapped": "^4.4.6",
        "@ionic-native/app-version": "^4.4.2",
        "@ionic-native/camera": "4.4.2",
        "@ionic-native/core": "^4.4.2",
        "@ionic-native/crop": "^4.4.2",
        "@ionic-native/date-picker": "^4.4.2",
        "@ionic-native/device": "^4.4.2",
        "@ionic-native/fcm": "^4.4.2",
        "@ionic-native/file": "4.4.2",
        "@ionic-native/image-resizer": "^4.4.2",
        "@ionic-native/in-app-browser": "^4.4.2",
        "@ionic-native/keyboard": "^4.4.2",
        "@ionic-native/local-notifications": "^4.4.2",
        "@ionic-native/native-storage": "^4.4.2",
        "@ionic-native/network": "^4.4.2",
        "@ionic-native/safari-view-controller": "^4.4.2",
        "@ionic-native/secure-storage": "^4.4.2",
        "@ionic-native/splash-screen": "4.4.2",
        "@ionic-native/status-bar": "4.4.2",
        "@ionic-native/toast": "^4.4.2",
        "@ionic/storage": "^2.1.3",
        "@types/async": "^2.0.45",
        "angular2-text-mask": "^8.0.4",
        "async": "^2.6.0",
        "async-es": "^2.6.0",
        "cordova-android": "^6.4.0",
        "cordova-ios": "^4.5.3",
        "cordova-plugin-app-event": "^1.2.1",
        "cordova-plugin-app-version": "^0.1.9",
        "cordova-plugin-camera": "^2.4.1",
        "cordova-plugin-console": "^1.0.7",
        "cordova-plugin-crop": "~0.3.1",
        "cordova-plugin-datepicker": "~0.9.3",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-fcm": "^2.1.2",
        "cordova-plugin-file": "^4.3.3",
        "cordova-plugin-image-resizer": "git+https://github.com/protonet/cordova-plugin-image-resizer.git",
        "cordova-plugin-inappbrowser": "~1.7.1",
        "cordova-plugin-nativestorage": "^2.2.2",
        "cordova-plugin-network-information": "~1.3.3",
        "cordova-plugin-safariviewcontroller": "^1.4.7",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "cordova-plugin-x-toast": "^2.6.0",
        "de.appplant.cordova.plugin.local-notification": "^0.8.5",
        "io": "^0.1.10",
        "ionic-angular": "^3.9.2",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionic2-auto-complete": "^1.5.3-beta",
        "ionicons": "3.0.0",
        "leaflet": "^1.1.0",
        "lodash": "^4.17.4",
        "moment": "^2.18.1",
        "ng2-validation": "^4.2.0",
        "ngx-restangular": "^2.0.1",
        "rxjs": "5.5.2",
        "socket.io": "^2.0.3",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.18"
    },
    "devDependencies": {
        "@ionic/app-scripts": "^3.1.2",
        "jsdoc": "^3.5.5",
        "ts-jsdoc": "^2.0.6",
        "typescript": "^2.4.2"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-nativestorage": {},
            "cordova-plugin-x-toast": {},
            "cordova-plugin-file": {},
            "cordova-plugin-camera": {},
            "cordova-plugin-console": {},
            "cordova-plugin-fcm": {},
            "cordova-plugin-safariviewcontroller": {},
            "cordova-plugin-crop": {},
            "cordova-plugin-datepicker": {},
            "cordova-plugin-inappbrowser": {},
            "de.appplant.cordova.plugin.local-notification": {},
            "cordova-plugin-app-version": {}
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}

and it’s my ``ìonic info```output

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.0.2
    ios-deploy        : 1.9.2 
    Node              : v8.9.1
    npm               : 5.5.1 
    OS                : macOS Sierra
    Xcode             : Xcode 9.1 Build version 9B55 

Environment Variables:

    ANDROID_HOME : /Users/user/Library/Android/sdk

Misc:

    backend : pro

When i tried execute ``ìonic cordova build ios --prod``` compiler fails with that error:

TypeError: tsDiagnostic.file.getText is not a function
    at loadDiagnostic (/Users/user/WebstormProjects/MDMProfileMobile/node_modules/@ionic/app-scripts/dist/logger/logger-typescript.js:32:44)
    at /Users/user/WebstormProjects/MDMProfileMobile/node_modules/@ionic/app-scripts/dist/logger/logger-typescript.js:13:16
    at Array.map (<anonymous>)
    at Object.runTypeScriptDiagnostics (/Users/user/WebstormProjects/MDMProfileMobile/node_modules/@ionic/app-scripts/dist/logger/logger-typescript.js:12:26)
    at /Users/user/WebstormProjects/MDMProfileMobile/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:231:59
    at step (/Users/user/WebstormProjects/MDMProfileMobile/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
    at Object.next (/Users/user/WebstormProjects/MDMProfileMobile/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
    at fulfilled (/Users/user/WebstormProjects/MDMProfileMobile/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
    at <anonymous>

Someone can help me with that problem?


#2

Same problem… any solution?


#3

Try run this command $./node_modules/.bin/ngc it saved my life trying to find what was causing the error


#4

At a morning i found problem, i extend if in typescript-logger and then compiler marks problem with https://github.com/kadoshms/ionic2-autocomplete

More info in: https://github.com/ionic-team/ionic-cli/issues/2889