ionic-cli: cli freezes while generating ES5 bundles

Description:

after running the command $ ionic cordova run android --device the cli freezes at Generating ES5 bundles for differential loading...

Steps to Reproduce:

  • $ ionic cordova plaform add android
  • $ ionic cordova run android --device

Output:

ionic cordova run android --device --verbose
  ionic:lib Terminal info: { ci: false, shell: '/bin/sh', tty: true, windows: false } +0ms
  ionic:lib CLI global options: { _: [ 'cordova', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, device: true, project: null, '--': [] } +7ms
  ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
  ionic:lib:project Project details: { configPath: '/Users/c.francia/Desktop/dicus/dicus/application/app/ionic.config.json', errors: [], context: 'app', type: 'angular' } +0ms
  ionic Context: { binPath: '/Users/c.francia/.config/yarn/global/node_modules/ionic/bin/ionic', libPath: '/Users/c.francia/.config/yarn/global/node_modules/ionic', execPath: '/Users/c.francia/Desktop/application/app', version: '5.4.13' } +0ms
  ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: '/Users/c.francia/Desktop/application/app/config.xml', package.json: '/Users/c.francia/Desktop/application/app/package.json') +0ms
  ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: '/Users/c.francia/Desktop/application/app/config.xml', package.json: '/Users/c.francia/Desktop/application/app/package.json') +239ms
  ionic:lib:telemetry Sending telemetry for command: 'ionic cordova run' [ 'android', '--device', '--verbose', '--interactive', '--color' ] +0ms
  ionic:lib:build build options: {
  ionic:lib:build   '--': [],
  ionic:lib:build   engine: 'cordova',
  ionic:lib:build   platform: 'android',
  ionic:lib:build   project: undefined,
  ionic:lib:build   verbose: false,
  ionic:lib:build   configuration: undefined,
  ionic:lib:build   sourcemaps: undefined,
  ionic:lib:build   cordovaAssets: true,
  ionic:lib:build   watch: undefined,
  ionic:lib:build   type: 'angular'
  ionic:lib:build } +0ms
  ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
  ionic:lib:build Looking for ionic:build npm script. +133ms
> ng run app:ionic-cordova-build --platform=android
  ng:analytics getGlobalAnalytics +0ms
  ng:analytics Client Analytics config found: false +494ms
  ng:analytics Analytics disabled. Ignoring all analytics. +0ms
  ng:analytics getSharedAnalytics +0ms
Generating ES5 bundles for differential loading...

My ionic info:

   Ionic CLI                     : 5.4.13 (/Users/c.francia/.config/yarn/global/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.11.7
   @angular-devkit/build-angular : 0.803.21
   @angular-devkit/schematics    : 8.3.21
   @angular/cli                  : 8.3.21
   @ionic/angular-toolkit        : 2.1.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0, ios 5.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.2, (and 19 other plugins)

Utility:

   cordova-res : 0.8.1
   native-run  : 0.3.0

System:

   ios-sim : 8.0.2
   NodeJS  : v12.7.0 (/usr/local/lib/node_modules/node/bin/node)
   npm     : 6.11.3
   OS      : macOS Mojave
   Xcode   : Xcode 11.2.1 Build version 11B500


Other Information:

this happens when using the command $ ionic cordova run android --device --lievreload howerver at a different section

> cordova build android --device
[INFO] ... and 78 additional chunks
[ng] ℹ 「wdm」: Compiled successfully.
[cordova] Note: Some input files use or override a deprecated API.
[cordova] Note: Recompile with -Xlint:deprecation for details.
[cordova] Note: Some input files use unchecked or unsafe operations.
[cordova] Note: Recompile with -Xlint:unchecked for details.
> native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --device --forward 8100:8100

if I leave it there then some time later (I don’t know how much time I was out for lunch but longer than 20 minutes) then it will finish.

Updates:

-these report files report.<timestamp>.json are being created from the ionic-cli

-I’ve tried increasing the memory outlined in this open issue setting my node env to export NODE_OPTIONS=--max_old_space_size=4096 however this is not solving the issue

-when stopping I get the error:

at new SubprocessError (/Users/c.francia/.config/yarn/global/node_modules/@ionic/utils-subprocess/dist/index.js:40:23)
at ChildProcess.<anonymous>
(/Users/c.francia/.config/yarn/global/node_modules/@ionic/utils-subprocess/dist/index.js:124:27)
at ChildProcess.emit (events.js:203:13)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

-whenever the error report is generated there is a package-lock.json file created, though yarn is the manager I am using

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 9
  • Comments: 27 (4 by maintainers)

Most upvoted comments

Edit tsconfig.son, change “target”: “es2015” to “target”: “es5”

@ctfrancia @davemake After a couple of hours, I finally solved this by downgrading the @angular-devkit/build-angular version from ^0.803.21 to ~0.801.2.

 "devDependencies": {
    "@angular-devkit/build-angular": "~0.801.2"
}

Then ionic repair and ionic build must work!

Edit tsconfig.son, change “target”: “es2015” to “target”: “es5”

Can someone explain why this works ?

Same here. Ionic5+Angular9. To change to es5 and to downgrade to Angular8 is not ultimate solution.

I submitted an issue with Angular for this: https://github.com/angular/angular-cli/issues/16520

This answer solved my issue as well:

After a couple of hours, I finally solved this by downgrading the @angular-devkit/build-angular version from ^0.803.21 to ~0.801.2.

“devDependencies”: { “@angular-devkit/build-angular”: “~0.801.2” }

Description:

after running the command $ ionic cordova run android --device the cli freezes at Generating ES5 bundles for differential loading...

Steps to Reproduce:

  • $ ionic cordova plaform add android
  • $ ionic cordova run android --device

Output:

ionic cordova run android --device --verbose
  ionic:lib Terminal info: { ci: false, shell: '/bin/sh', tty: true, windows: false } +0ms
  ionic:lib CLI global options: { _: [ 'cordova', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, device: true, project: null, '--': [] } +7ms
  ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
  ionic:lib:project Project details: { configPath: '/Users/c.francia/Desktop/dicus/dicus/application/app/ionic.config.json', errors: [], context: 'app', type: 'angular' } +0ms
  ionic Context: { binPath: '/Users/c.francia/.config/yarn/global/node_modules/ionic/bin/ionic', libPath: '/Users/c.francia/.config/yarn/global/node_modules/ionic', execPath: '/Users/c.francia/Desktop/application/app', version: '5.4.13' } +0ms
  ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: '/Users/c.francia/Desktop/application/app/config.xml', package.json: '/Users/c.francia/Desktop/application/app/package.json') +0ms
  ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: '/Users/c.francia/Desktop/application/app/config.xml', package.json: '/Users/c.francia/Desktop/application/app/package.json') +239ms
  ionic:lib:telemetry Sending telemetry for command: 'ionic cordova run' [ 'android', '--device', '--verbose', '--interactive', '--color' ] +0ms
  ionic:lib:build build options: {
  ionic:lib:build   '--': [],
  ionic:lib:build   engine: 'cordova',
  ionic:lib:build   platform: 'android',
  ionic:lib:build   project: undefined,
  ionic:lib:build   verbose: false,
  ionic:lib:build   configuration: undefined,
  ionic:lib:build   sourcemaps: undefined,
  ionic:lib:build   cordovaAssets: true,
  ionic:lib:build   watch: undefined,
  ionic:lib:build   type: 'angular'
  ionic:lib:build } +0ms
  ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
  ionic:lib:build Looking for ionic:build npm script. +133ms
> ng run app:ionic-cordova-build --platform=android
  ng:analytics getGlobalAnalytics +0ms
  ng:analytics Client Analytics config found: false +494ms
  ng:analytics Analytics disabled. Ignoring all analytics. +0ms
  ng:analytics getSharedAnalytics +0ms
Generating ES5 bundles for differential loading...

My ionic info:

   Ionic CLI                     : 5.4.13 (/Users/c.francia/.config/yarn/global/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.11.7
   @angular-devkit/build-angular : 0.803.21
   @angular-devkit/schematics    : 8.3.21
   @angular/cli                  : 8.3.21
   @ionic/angular-toolkit        : 2.1.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0, ios 5.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.2, (and 19 other plugins)

Utility:

   cordova-res : 0.8.1
   native-run  : 0.3.0

System:

   ios-sim : 8.0.2
   NodeJS  : v12.7.0 (/usr/local/lib/node_modules/node/bin/node)
   npm     : 6.11.3
   OS      : macOS Mojave
   Xcode   : Xcode 11.2.1 Build version 11B500

Other Information:

this happens when using the command $ ionic cordova run android --device --lievreload howerver at a different section

> cordova build android --device
[INFO] ... and 78 additional chunks
[ng] ℹ 「wdm」: Compiled successfully.
[cordova] Note: Some input files use or override a deprecated API.
[cordova] Note: Recompile with -Xlint:deprecation for details.
[cordova] Note: Some input files use unchecked or unsafe operations.
[cordova] Note: Recompile with -Xlint:unchecked for details.
> native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --device --forward 8100:8100

if I leave it there then some time later (I don’t know how much time I was out for lunch but longer than 20 minutes) then it will finish.

Updates:

-these report files report.<timestamp>.json are being created from the ionic-cli

-I’ve tried increasing the memory outlined in this open issue setting my node env to export NODE_OPTIONS=--max_old_space_size=4096 however this is not solving the issue

-when stopping I get the error:

at new SubprocessError (/Users/c.francia/.config/yarn/global/node_modules/@ionic/utils-subprocess/dist/index.js:40:23)
at ChildProcess.<anonymous>
(/Users/c.francia/.config/yarn/global/node_modules/@ionic/utils-subprocess/dist/index.js:124:27)
at ChildProcess.emit (events.js:203:13)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

-whenever the error report is generated there is a package-lock.json file created, though yarn is the manager I am using

I Solved This Problem By Re-Building.Below are the steps i followed

  1. ionic cordova build
  2. ionic cordova run android --verbose

I think while it was stuck at generating ES5 bundles it might be building the app.

I’m on latest version for all packages. Still issues exists below is my package.json

Do I need to upgrade or downgrade any package to resolve this issue?

“dependencies”: { “@angular/common”: “9.1.9”, “@angular/core”: “9.1.9”, “@angular/forms”: “9.1.9”, “@angular/platform-browser”: “9.1.9”, “@angular/platform-browser-dynamic”: “9.1.9”, “@angular/router”: “9.1.9”, “@ionic-native/calendar”: “5.26.0”, “@ionic-native/camera”: “5.26.0”, “@ionic-native/core”: “5.26.0”, “@ionic-native/device”: “5.26.0”, “@ionic-native/document-viewer”: “5.26.0”, “@ionic-native/file”: “5.26.0”, “@ionic-native/file-opener”: “5.26.0”, “@ionic-native/file-path”: “5.26.0”, “@ionic-native/fingerprint-aio”: “5.26.0”, “@ionic-native/http”: “5.26.0”, “@ionic-native/in-app-browser”: “5.26.0”, “@ionic-native/ionic-webview”: “5.26.0”, “@ionic-native/keyboard”: “5.26.0”, “@ionic-native/network”: “5.26.0”, “@ionic-native/push”: “5.26.0”, “@ionic-native/secure-storage”: “5.26.0”, “@ionic-native/splash-screen”: “5.26.0”, “@ionic-native/status-bar”: “5.26.0”, “@ionic/angular”: “5.1.1”, “@ionic/storage”: “2.2.0”, “@mobiscroll/angular”: “4.10.3”, “@ng-idle/core”: “8.0.0-beta.4”, “@ng-idle/keepalive”: “8.0.0-beta.4”, “@ngx-translate/core”: “12.1.2”, “@ngx-translate/http-loader”: “4.0.0”, “camelcase-keys”: “^6.2.2”, “cordova-android”: “8.1.0”, “cordova-ios”: “5.1.1”, “cordova-plugin-advanced-http”: “2.4.1”, “cordova-plugin-calendar”: “5.1.5”, “cordova-plugin-camera”: “4.1.0”, “cordova-plugin-device”: “2.0.3”, “cordova-plugin-document-viewer”: “0.9.13”, “cordova-plugin-file”: “6.0.2”, “cordova-plugin-file-opener2”: “3.0.1”, “cordova-plugin-filepath”: “1.5.8”, “cordova-plugin-fingerprint-aio”: “3.0.1”, “cordova-plugin-inappbrowser”: “3.2.0”, “cordova-plugin-ionic-keyboard”: “2.2.0”, “cordova-plugin-ionic-webview”: “4.2.1”, “cordova-plugin-network-information”: “2.0.2”, “cordova-plugin-secure-storage-echo”: “5.0.1”, “cordova-plugin-splashscreen”: “5.0.3”, “cordova-plugin-statusbar”: “2.4.3”, “cordova-plugin-whitelist”: “1.3.4”, “cordova-support-google-services”: “1.4.0”, “core-js”: “^3.6.5”, “credit-card-type”: “^8.3.0”, “json-stringify-safe”: “^5.0.1”, “libphonenumber-js”: “^1.7.51”, “lodash.merge”: “^4.6.2”, “mime”: “^2.4.5”, “moment”: “^2.26.0”, “phonegap-plugin-multidex”: “^1.0.0”, “phonegap-plugin-push”: “^2.3.0”, “rxjs”: “^6.5.5”, “tslib”: “^1.13.0”, “zone.js”: “^0.10.3” }, “devDependencies”: { “@angular-devkit/build-angular”: “0.901.7”, “@angular/cli”: “9.1.7”, “@angular/compiler”: “9.1.9”, “@angular/compiler-cli”: “9.1.9”, “@angular/language-service”: “9.1.9”, “@ionic/angular-toolkit”: “2.2.0”, “@types/credit-card-type”: “7.0.0”, “@types/crypto-js”: “3.1.47”, “@types/google-maps”: “3.2.2”, “@types/jasmine”: “3.5.10”, “@types/jasminewd2”: “2.0.8”, “@types/json-stringify-safe”: “5.0.0”, “@types/lodash.merge”: “4.6.6”, “@types/mime”: “2.0.2”, “@types/node”: “14.0.5”, “@types/url-parse”: “1.4.3”, “ajv”: “^6.12.2”, “codelyzer”: “^5.2.2”, “husky”: “^4.2.5”, “jasmine-core”: “3.5.0”, “jasmine-spec-reporter”: “~5.0.2”, “karma”: “5.0.9”, “karma-chrome-launcher”: “3.1.0”, “karma-coverage-istanbul-reporter”: “3.0.2”, “karma-jasmine”: “3.1.1”, “karma-jasmine-html-reporter”: “1.5.4”, “npm-run-all”: “^4.1.5”, “protractor”: “7.0.0”, “ts-node”: “8.10.1”, “tslint”: “6.1.2”, “typescript”: “~3.8.3” },

In our case, what helped was updating those packages:

npm install codelyzer@latest --save
npm install rxjs-compat@latest --save

(Checked outdated packages with npm outdated)

Now it seems to work even with the es2015 target.

Edit tsconfig.son, change “target”: “es2015” to “target”: “es5”

Worked for me as well:

Ionic:

Ionic CLI : 6.1.0 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.0.0 @angular-devkit/build-angular : 0.803.25 @angular-devkit/schematics : 8.3.25 @angular/cli : 8.3.25 @ionic/angular-toolkit : 2.1.2

Utility:

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

System:

NodeJS : v10.16.2 (/usr/local/bin/node) npm : 6.13.7 OS : macOS Mojave

Edit tsconfig.son, change “target”: “es2015” to “target”: “es5” this is working for me.

@derickfelix Thank you so much!