ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.95k stars 13.51k forks source link

bug: ERROR in 4.0fbc7e4dca18c73d92e3.js from Terser Unexpected token: punc ()) #18922

Closed carlos2712 closed 5 years ago

carlos2712 commented 5 years ago

Bug Report

After running ionic cordova build ios --prod got this error back:

-I tried downgrading terser to 3.14 -I was using ionic 4.11.0 and updgrade it to 5.2.3 but it didn't work either.

ionic cordova build ios is working but when I add --prod failed.

ERROR in 4.0fbc7e4dca18c73d92e3.js from Terser Unexpected token: punc ()) [4.0fbc7e4dca18c73d92e3.js:192,6] [ERROR] An error occurred while running subprocess ng.

Ionic version:

[x] 4.x

Current behavior:

After running ionic cordova build ios --pro Expected behavior:

Steps to reproduce:

Related code:

Package Json

{
  "name": "",
  "version": "1.0.0",
  "author": ",.",
  "homepage": "",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "config": {
    "ionic_generate_source_map": "true"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.1.3",
    "@angular/cdk": "^8.1.1",
    "@angular/common": "^8.1.3",
    "@angular/core": "^8.1.3",
    "@angular/forms": "^8.1.3",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^8.1.3",
    "@angular/platform-browser-dynamic": "^8.1.3",
    "@angular/pwa": "^0.801.2",
    "@angular/router": "^8.1.3",
    "@angular/service-worker": "^8.1.3",
    "@ionic-native/barcode-scanner": "^5.10.0",
    "@ionic-native/base64": "^5.10.0",
    "@ionic-native/camera": "^5.10.0",
    "@ionic-native/camera-preview": "^5.10.0",
    "@ionic-native/core": "^5.10.0",
    "@ionic-native/file": "^5.10.0",
    "@ionic-native/file-path": "^5.10.0",
    "@ionic-native/in-app-browser": "^5.10.0",
    "@ionic-native/ionic-webview": "^5.10.0",
    "@ionic-native/keyboard": "^5.10.0",
    "@ionic-native/keychain": "^5.10.0",
    "@ionic-native/keychain-touch-id": "^5.10.0",
    "@ionic-native/network": "^5.10.0",
    "@ionic-native/splash-screen": "^5.10.0",
    "@ionic-native/status-bar": "^5.10.0",
    "@ionic/angular": "^4.7.1",
    "@ionic/core": "^4.7.1",
    "@ionic/pro": "^2.0.4",
    "@ionic/storage": "^2.2.0",
    "@mobiscroll/angular": "^4.7.3",
    "angular-font-awesome": "^3.1.2",
    "br-mask": "0.0.7",
    "com-badrit-base64": "^0.2.0",
    "cordova-android": "8.0.0",
    "cordova-browser": "6.0.0",
    "cordova-ios": "5.0.1",
    "cordova-osx": "5.0.0",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-camera-preview": "^0.11.0",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-document-viewer": "^0.9.11",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-filepath": "^1.5.5",
    "cordova-plugin-fingerprint-aio": "^1.7.0",
    "cordova-plugin-inappbrowser": "^3.1.0",
    "cordova-plugin-ionic": "^5.4.1",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^4.1.1",
    "cordova-plugin-keychain-touch-id": "^3.2.1",
    "cordova-plugin-network-information": "^2.0.2",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-sqlite-storage": "^3.2.1",
    "cordova-windows": "^7.0.0",
    "core-js": "^2.6.9",
    "font-awesome": "^4.7.0",
    "ionic": "^5.2.3",
    "ionic-selectable": "^4.4.0",
    "jimp": "^0.6.4",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.26",
    "ngx-image-viewer": "^1.0.13",
    "ngx-progressive-image-loader": "^3.0.2",
    "phonegap-plugin-barcodescanner": "^8.1.0",
    "rxjs": "^6.5.2",
    "rxjs-compat": "^6.5.1",
    "sentry-cordova": "^0.15.0",
    "tesseract.js": "^2.0.0-alpha.13",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.801.2",
    "@angular-devkit/build-angular": "^0.801.2",
    "@angular-devkit/core": "^8.1.2",
    "@angular-devkit/schematics": "^8.1.2",
    "@angular/cli": "^8.1.2",
    "@angular/compiler": "^8.1.3",
    "@angular/compiler-cli": "^8.1.3",
    "@angular/language-service": "^8.1.3",
    "@ionic/angular-toolkit": "2.0.0",
    "@types/faker": "^4.1.5",
    "@types/jasmine": "3.3.15",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "12.6.8",
    "codelyzer": "^5.1.0",
    "faker": "^4.1.0",
    "jasmine-allure-reporter": "^1.0.2",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^3.1.4",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage-istanbul-reporter": "^2.1.0",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "protractor-jasmine2-html-reporter": "0.0.7",
    "terser": "^4.1.2",
    "ts-node": "^8.3.0",
    "tslint": "^5.18.0",
    "typescript": "3.4.5"
  },
  "description": "iPro Lite Version",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "phonegap-plugin-barcodescanner": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-document-viewer": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-fingerprint-aio": {
        "FACEID_USAGE_DESCRIPTION": " "
      },
      "cordova-plugin-keychain-touch-id": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-file": {},
      "cordova-plugin-filepath": {},
      "cordova-plugin-ionic": {
        "APP_ID": "e08da140",
        "CHANNEL_NAME": "Production",
        "UPDATE_METHOD": "none",
        "UPDATE_API": "https://api.ionicjs.com",
        "MAX_STORE": "2",
        "MIN_BACKGROUND_DURATION": "30"
      },
      "sentry-cordova": {},
      "cordova-plugin-camera-preview": {},
      "cordova-plugin-genius-scan": {
        "CAMERA_USAGE_DESCRIPTION": "This app needs camera access"
      },
      "com-badrit-base64": {}
    },
    "platforms": [
      "browser",
      "osx",
      "windows",
      "ios"
    ]
  }
}

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.2.3
   Ionic Framework               : @ionic/angular 4.7.1
   @angular-devkit/build-angular : 0.801.2
   @angular-devkit/schematics    : 8.1.2
   @angular/cli                  : 8.1.2
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.1
   NodeJS     : v10.16.0 (/usr/local/bin/node)
   npm        : 6.9.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.3 Build version 10G8
danielsogl commented 5 years ago

Follow the guide provided here: https://update.angular.io/ I noticed the deprecated @angular/http package inside your package.json that will not work with Angular 8.

liamdebeasi commented 5 years ago

Thanks for the issue. Can you try the steps provided by @danielsogl and let me know if that resolves your issue?

carlos2712 commented 5 years ago

@liamdebeasi after update the http package to the module. I'm still experiencing the same issue :

Screen Shot 2019-07-29 at 9 17 41 AM
liamdebeasi commented 5 years ago

Thanks for the follow up. Are you able to provide a repo where this issue happens?

carlos2712 commented 5 years ago

@liamdebeasi thanks for the help, one of the installed plugins was outdated.

ionitron-bot[bot] commented 5 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.