Hello,
Regarding: Angular 6.1, Angular CLI 6.0, Syncfusion Libraries as follows (from package.json), Google Chrome, Apple Safari:
...
"@syncfusion/ej2-angular-base": "^17.1.49",
"@syncfusion/ej2-angular-buttons": "^17.1.47",
"@syncfusion/ej2-angular-calendars": "^17.1.49",
"@syncfusion/ej2-angular-dropdowns": "^17.1.49",
"@syncfusion/ej2-angular-grids": "^17.1.48",
"@syncfusion/ej2-angular-inputs": "^17.1.49",
"@syncfusion/ej2-base": "^17.1.49",
"@syncfusion/ej2-data": "^17.1.47",
"@syncfusion/ej2-navigations": "^17.1.49",
...
I am trying to create a production build from a solution that includes various Syncfusion libraries such as EJ2 Grid, EJ2 Date Picker, and others as listed above, using the command ng build --prod. If the build-optimiser option is disabled (as set in the angular.json file or using the relevant CLI flag) the resultant production build works with no major issues. However, including build-optimizer results in a production build that crashes with various errors similar to the following as reproduced from the web browser console:
ERROR ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
at new Jt (ej2-grids.es2015.js.pre-build-optimizer.js:10671)
at new mi (ej2-angular-grids.js.pre-build-optimizer.js:295)
at Oo (core.js.pre-build-optimizer.js:11738)
at So (core.js.pre-build-optimizer.js:11559)
at sa (core.js.pre-build-optimizer.js:13100)
at Object.Xo [as createEmbeddedView] (core.js.pre-build-optimizer.js:12959)
at no.createEmbeddedView (core.js.pre-build-optimizer.js:11064)
at Yi.createEmbeddedView (core.js.pre-build-optimizer.js:10845)
at Be._updateView (common.js.pre-build-optimizer.js:3878)
at Be.set ngIf [as ngIf] (common.js.pre-build-optimizer.js:3846)
The element, in this case the EJ2 grid, does not render and the web app stalls. Similar errors encountered elsewhere in the web app have the same ReferenceError and the stack trace always includes reference to an EJ2 library.
This issue is not reproducible in development builds.
It is believed that the Angular Build Optimizer does not seem to play well with the EJ2 libraries and I know from exploring the Syncfusion forum and looking elsewhere at other community resources that this is a problem with certain libraries.
- Is there any workaround? I am not too keen on disabling Build Optimizer support as the resulting production build chunks are too large without its optimisations.
- Is there any potential fix in the pipeline. I had tried to use an updated version of the Angular Build Optimizer, i.e. version 0.13.9, but this did not help.