ionic-team / ionic-team/ionic-cli

Uncaught TypeError: P.a.defineLocale is not a function --prod

未關閉
#2,877 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

When built with --prod , I got this error :

```
vendor.js:1 Uncaught TypeError: P.a.defineLocale is not a function
vendor.js:1 Ionic Native: deviceready event fired after 371 ms
```

I can't track it back , since it's minified and uglified , my code has no such a functions `defineLocale `

here is some is ionic info:

```

cli packages: (C:\Users\Abanoub\AppData\Roaming\npm\node_modules)

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

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.0
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2

System:

Android SDK Tools : 25.2.3
Node : v8.9.1
npm : 5.5.1
OS : Windows 7

Environment Variables:

ANDROID_HOME : C:\Program Files (x86)\Android\android-sdk

Misc:

backend : legacy

```

and the package.json :
```

.....
"dependencies": {
"@angular/animations": "5.0.0",
"@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",
"@ionic-native/camera": "4.4.0",
"@ionic-native/core": "4.4.0",
"@ionic-native/date-picker": "^4.4.0",
"@ionic-native/deeplinks": "^4.4.0",
"@ionic-native/device": "^4.4.0",
"@ionic-native/dialogs": "^4.4.0",
"@ionic-native/facebook": "4.4.0",
"@ionic-native/file": "4.4.0",
"@ionic-native/file-path": "^4.4.0",
"@ionic-native/file-transfer": "4.4.0",
"@ionic-native/geolocation": "^4.4.0",
"@ionic-native/google-plus": "4.4.0",
"@ionic-native/header-color": "4.4.0",
"@ionic-native/http": "4.4.0",
"@ionic-native/push": "^4.4.0",
"@ionic-native/social-sharing": "^4.4.0",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic-native/transfer": "^3.14.0",
"@ionic/storage": "^2.1.3",
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "^0.1.0",
"angular-draggable-droppable": "^1.1.0",
"angular-resizable-element": "^1.2.3",
"cordova-android": "~6.3.0",
"cordova-ios": "^4.5.3",
"cordova-plugin-camera": "^2.4.1",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-datepicker": "^0.9.3",
"cordova-plugin-device": "^1.1.6",
"cordova-plugin-facebook4": "^1.9.1",
"cordova-plugin-file": "^4.3.0",
"cordova-plugin-file-transfer": "^1.6.3",
"cordova-plugin-filepath": "^1.1.0",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-googleplus": "^5.1.1",
"cordova-plugin-headercolor": "^1.0.0",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.3",
"cordova-plugin-whitelist": "^1.3.2",
"cordova-plugin-x-socialsharing": "^5.2.1",
"cordova-sqlite-storage": "^2.1.1",
"es6-promise-plugin": "^4.1.0",
"ionic-angular": "3.9.2",
"ionic-image-loader": "^4.2.1",
"ionic-plugin-deeplinks": "^1.0.15",
"ionic-plugin-keyboard": "^2.2.1",
"ionic2-rating": "^1.2.2",
"ionicons": "3.0.0",
"moment": "^2.19.1",
"ng2-validation": "^4.2.0",
"phonegap-plugin-push": "^2.1.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.0",
"typescript": "2.4.2"
}
.......
```

it only happens when built with --prod , if built without it , everything works fine!

貢獻指南

開啟貢獻指南

研究方向

Start with the package.json dependencies and reproduce the production build using --prod, then inspect the minified vendor.js error around defineLocale. Done means identifying the production-only cause, fixing it, and verifying that both production and non-production builds work.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, typescript
領域
build-system, cli
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。