# Ionic cordova build Get Stuck at "Generating ES5 bundles for differential loading..."

**URL:** <https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202>\
**Category:** Ionic Framework\
**Created:** [December 22, 2019, 6:18pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202 "2019-12-22T18:18:09Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomjaihk](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@tomjaihk](https://forum.ionicframework.com/u/tomjaihk)\
**Post date:** [December 22, 2019, 6:18pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/1 "2019-12-22T18:18:09Z")

</div>

When I was building my ionic app via “ionic cordova run android --device --verbose”, it got stuck at …

```auto

> ng.cmd run app:ionic-cordova-build --platform=android
  ng:analytics getGlobalAnalytics +0ms
  ng:analytics Client Analytics config found: false +38ms
  ng:analytics Analytics disabled. Ignoring all analytics. +0ms
  ng:analytics getSharedAnalytics +1ms
Generating ES5 bundles for differential loading...

```

I had been loading for over 10 minutes. I don’t know how to handle!

Here is the information of the modules:

> npm: 6.9.0  
> ionic: 5.4.13  
> cordova: 9.0.0 (cordova-lib@9.0.1)

Thank you.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [December 22, 2019, 10:47pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/2 "2019-12-22T22:47:13Z")

</div>

One thing you can try is to make it not do that.

Change your `browserslist` to read:

```auto
last 2 Chrome versions
last 2 Safari versions

```

(for example), and it won’t bother building ES5 bundles.

---

<div class="post-metadata">

**Author:** ![tomjaihk](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@tomjaihk](https://forum.ionicframework.com/u/tomjaihk)\
**Post date:** [December 23, 2019, 1:18am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/3 "2019-12-23T01:18:11Z")

</div>

My existing browserlist:

```auto
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.

```

How should I place your things? Thanks.

---

<div class="post-metadata">

**Author:** ![keber](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@keber](https://forum.ionicframework.com/u/keber)\
**Post date:** [December 23, 2019, 9:05am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/4 "2019-12-23T09:05:51Z")

</div>

Same issue here. Running the cordova build command with --verbose, I get this error message:

```auto
[error] Error: Call retries were exceeded
    at ChildProcessWorker.initialize (/Users/me/Documents/apps/myapp/node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
    at ChildProcessWorker.onExit (/Users/me/Documents/apps/myapp/node_modules/jest-worker/build/workers/ChildProcessWorker.js:263:12)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

```

It seems to be connected with this issue:

> <https://github.com/angular/angular-cli/issues/15493>
>
> 🐞 Bug report
> Command (mark with an x)
> \- \[\] new
> \- \[x \] build
> \- \[\] serve
> \- \[\] test
> \- \[\]...

But I still can’t manage to get it solved.

**Edit** : Error occurs on one of my projects only. For all others I can build without any problems. Could there be a performance issue with cordova/Ionic? My machine (MBP, 2,7 GHz i7, 16 GB RAM) should be able to build my projects I guess…

**EDIT2 / Temporary solution:**  
There was a change in _@angular-devkit/build-angular_ which updated the differential loading. To fix this in your Ionic project, change the target value from “es2015” to “es5” in your _tsconfig.json_:

```auto
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

```

Let’s hope there’s a real fix for that soon but in the meantime we at least can build our projects.

---

<div class="post-metadata">

**Author:** ![Mlifonza](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Mlifonza](https://forum.ionicframework.com/u/Mlifonza)\
**Post date:** [December 23, 2019, 6:05pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/5 "2019-12-23T18:05:55Z")

</div>

This actually assisted me very much. I was able to build my project and run it on a real device. Thank you!

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [December 23, 2019, 7:16pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/6 "2019-12-23T19:16:15Z")

</div>

Replace all lines that don’t start with a `#` with them.

---

<div class="post-metadata">

**Author:** ![keni](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/keni/32/129898_2.png) [@keni](https://forum.ionicframework.com/u/keni)\
**Post date:** [December 24, 2019, 9:01am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/7 "2019-12-24T09:01:40Z")

</div>

Bingo result, thanks

---

<div class="post-metadata">

**Author:** ![alitalaee](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@alitalaee](https://forum.ionicframework.com/u/alitalaee)\
**Post date:** [December 26, 2019, 12:30am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/8 "2019-12-26T00:30:57Z")

</div>

really thank you  
it is useful for me

---

<div class="post-metadata">

**Author:** ![jcgz100](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@jcgz100](https://forum.ionicframework.com/u/jcgz100)\
**Post date:** [December 26, 2019, 6:03pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/9 "2019-12-26T18:03:43Z")

</div>

> [@keber](#):
>
> “es2015” to “es5”

Thanks a lot, this help me

---

<div class="post-metadata">

**Author:** ![simmi23](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@simmi23](https://forum.ionicframework.com/u/simmi23)\
**Post date:** [December 30, 2019, 5:59am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/10 "2019-12-30T05:59:01Z")

</div>

Thank you! It works for me

---

<div class="post-metadata">

**Author:** ![alaswer](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/alaswer/32/130298_2.png) [@alaswer](https://forum.ionicframework.com/u/alaswer)\
**Post date:** [January 1, 2020, 7:38am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/11 "2020-01-01T07:38:04Z")

</div>

Worked for me. Thank you!

---

<div class="post-metadata">

**Author:** ![peterennis](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/peterennis/32/91860_2.png) [@peterennis](https://forum.ionicframework.com/u/peterennis)\
**Post date:** [January 2, 2020, 4:54am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/12 "2020-01-02T04:54:46Z")

</div>

Worked for me too 👍

---

<div class="post-metadata">

**Author:** ![andyhb](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@andyhb](https://forum.ionicframework.com/u/andyhb)\
**Post date:** [January 7, 2020, 10:22pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/13 "2020-01-07T22:22:36Z")

</div>

thanks that sorted the issue for me to!

---

<div class="post-metadata">

**Author:** ![DavidEccles](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@DavidEccles](https://forum.ionicframework.com/u/DavidEccles)\
**Post date:** [July 23, 2020, 2:38pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/14 "2020-07-23T14:38:30Z")

</div>

> [@rapropos](#):
>
> ```auto
> last 2 Chrome versions
> last 2 Safari versions
> 
> ```

nice, helped me, now lets see if my google maps work haha thanks!

---

<div class="post-metadata">

**Author:** ![AresDevX](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aresdevx/32/136018_2.png) [@AresDevX](https://forum.ionicframework.com/u/AresDevX)\
**Post date:** [January 27, 2021, 2:43pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/15 "2021-01-27T14:43:28Z")

</div>

> [@keber](#):
>
> nning the cordova build command with --verbose, I get this

For anyone else experiencing this problem, I’ve realized that I had some circular references in modules configuration(imports/exports) fixing that circular references make the problem go away.

---

<div class="post-metadata">

**Author:** ![chinedu50](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chinedu50/32/110684_2.png) [@chinedu50](https://forum.ionicframework.com/u/chinedu50)\
**Post date:** [March 26, 2021, 10:28am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/16 "2021-03-26T10:28:21Z")

</div>

I ran into more issues after changing to ‘es5’. But a solution that always work without needed to change anything, Is to build for angular first. Run:

```auto
ng build

```

Then

```auto
Ionic cordova build android

```

---

<div class="post-metadata">

**Author:** ![basavarajbhavi](https://avatars.discourse-cdn.com/v4/letter/b/d9b06d/32.png) [@basavarajbhavi](https://forum.ionicframework.com/u/basavarajbhavi)\
**Post date:** [June 4, 2021, 1:00pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/17 "2021-06-04T13:00:31Z")

</div>

no use after changing es2015 to es5

---

<div class="post-metadata">

**Author:** ![nirmal98kumar](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@nirmal98kumar](https://forum.ionicframework.com/u/nirmal98kumar)\
**Post date:** [August 10, 2022, 1:16pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/18 "2022-08-10T13:16:44Z")

</div>

this is proper solution
