Ionic 3 - 应用程序在使用--prod

时间:2017-12-05 21:53:04

标签: javascript angular typescript ionic2 ionic3

仅在 - prod 和手机(Android)上发生。一个奇怪的事情是,如果我触摸任何地方(即使它全是白色),那个应该在该特定位置被触发的事件被触发,并且突然显示内容。

我读过一些与 @ ionic / app-scripts 有冲突的TypeScript版本以及我需要如何降级到TypeScript 2.0.x,但如果我这样做,我会在构建时遇到错误喊道:

  

无法读取未定义的属性“私有”:tsickle.js:118:40

我想这与我的依赖项的所有其他版本有关,与该版本的TS冲突。

这是我的package.json:

 {
  "name": "green-dragon",
  "version": "0.0.1",
  "author": "Test",
  "homepage": "http://www.huskysoftware.com.ar/",
  "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"
  },
  "dependencies": {
    "@angular/common": "4.4.3",
    "@angular/compiler": "4.4.3",
    "@angular/compiler-cli": "4.4.3",
    "@angular/core": "4.4.3",
    "@angular/forms": "4.4.3",
    "@angular/http": "4.4.3",
    "@angular/platform-browser": "4.4.3",
    "@angular/platform-browser-dynamic": "4.4.3",
    "@ionic-native/core": "4.3.0",
    "@ionic-native/geolocation": "^4.4.2",
    "@ionic-native/network": "^4.3.1",
    "@ionic-native/splash-screen": "4.3.0",
    "@ionic-native/status-bar": "4.3.0",
    "cordova-android": "6.3.0",
    "cordova-ios": "^4.5.1",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-device": "^1.1.4",
    "cordova-plugin-geolocation": "^3.0.0",
    "cordova-plugin-ionic-webview": "^1.1.15",
    "cordova-plugin-network-information": "^1.3.3",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git",
    "cordova-plugin-whitelist": "^1.3.1",
    "ionic-angular": "3.7.1",
    "ionic-native": "^2.9.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "lodash": "^4.17.4",
    "moment": "^2.19.1",
    "rxjs": "5.4.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.4",
    "typescript": "2.0.9"
  },
  "description": "A beer map app",
  "cordova": {
    "plugins": {
      "cordova-plugin-device": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": "Encontrar bares cercanos"
      }
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

显然,--minifyjs标志就是这里的标志。但仍然不知道为什么

1 个答案:

答案 0 :(得分:1)

我想在这里提供2条线索。

  1. --prod使用AOT。因此,您无法在private文件中使用*.html属性。所以你需要找出你使用它的位置。希望此错误可以帮助您找到它。 Cannot read property 'Private' of undefined: tsickle.js:118:40

  2. 我强烈建议您将应用升级到最新的Ionic 3.9.2