Core: ERROR in Cannot read property 'push' of undefined

Created on 27 Feb 2020  Â·  5Comments  Â·  Source: ngx-translate/core

Error while compiling for Angular 9:

$ ng build --configuration=my-prod-config
0% compiling
Compiling @ngx-translate/core : es2015 as esm2015

Compiling @angular/common/http : es2015 as esm2015

Compiling @ngx-translate/http-loader : es2015 as esm2015



ERROR in Cannot read property 'push' of undefined

Environment:

@ngx-translate/[email protected]
@ngx-translate/[email protected]
$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.3
Node: 13.1.0
OS: linux x64

Angular: 9.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              9.0.3
@angular-devkit/schematics        9.0.3
@angular/cdk                      9.1.0
@angular/flex-layout              9.0.0-beta.29
@angular/material                 9.1.0
@ngtools/webpack                  9.0.3
@schematics/angular               9.0.3
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Most helpful comment

The lastest angular version seems to fix this issue. (9.0.4)

All 5 comments

Same error after updating angular to the latest version.

Compiling @ngx-translate/http-loader : es2015 as esm2015 Error: Error on worker #3: TypeError: Cannot read property 'push' of undefined at SourceFile.renderFlattenedSourceMap (xxx\node_modules\@angular\compiler-cli\ngcc\src\sourcemaps\source_file.js:73:33) at Object.renderSourceAndMap (xxx\node_modules\@angular\compiler-cli\ngcc\src\rendering\source_maps.js:34:42) at Renderer.renderFile (xxx\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:93:38) at xxx\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:50:84 at Array.forEach (<anonymous>) at Renderer.renderProgram (xxx\node_modules\@angular\compiler-cli\ngcc\src\rendering\renderer.js:45:54) at Transformer.transform (xxx\node_modules\@angular\compiler-cli\ngcc\src\packages\transformer.js:77:42) at ClusterWorker.compile (xxx\node_modules\@angular\compiler-cli\ngcc\src\main.js:168:42) at Worker.<anonymous> (xxx\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\worker.js:44:42) at Worker.emit (events.js:321:20) at ClusterMaster.onWorkerMessage (xxx\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:158:27) at xxx\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:46:95 at ClusterMaster.<anonymous> (xxx\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:238:57) at step (xxx\node_modules\tslib\tslib.js:136:27) at Object.next (xxx\node_modules\tslib\tslib.js:117:57) at xxx\node_modules\tslib\tslib.js:110:75 at new Promise (<anonymous>) at Object.__awaiter (xxx\node_modules\tslib\tslib.js:106:16) at EventEmitter.<anonymous> (xxx\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:232:32) at EventEmitter.emit (events.js:321:20)

````
λ ng version

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ â–³ \ | '_ \ / _| | | | |/ _ | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ __| |_|__, |__,_|_|__,_|_| ____|_____|___|
|___/

Angular CLI: 9.0.3
Node: 13.8.0
OS: win32 x64

Angular: 9.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.803.23
@angular-devkit/build-angular 0.900.3
@angular-devkit/build-optimizer 0.900.3
@angular-devkit/build-webpack 0.900.3
@angular-devkit/core 8.3.23
@angular-devkit/schematics 9.0.3
@angular-devkit/schematics-cli 0.900.3
@angular/cdk 9.1.0
@angular/flex-layout 9.0.0-beta.29
@angular/material 9.1.0
@angular/material-moment-adapter 9.1.0
@ngtools/webpack 9.0.3
@schematics/angular 9.0.3
@schematics/schematics 0.900.3
@schematics/update 0.900.3
rxjs 6.5.4
typescript 3.7.5
webpack 4.41.2
````

Same error.

Environment:

"@ngx-translate/core": "11.0.0"
"@ngx-translate/http-loader": "4.0.0"
Angular CLI: 9.0.3
Node: 12.16.1
OS: win32 x64

Angular: 9.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, platform-server, router
Ivy Workspace: <error>


Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              9.0.3
@angular-devkit/schematics        9.0.3
@angular/cdk                      8.2.3
@angular/http                     7.2.16
@ngtools/webpack                  9.0.3
@schematics/angular               9.0.3
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.7.5
webpack

The error message just show:

ERROR in Cannot read property 'push' of undefined

The lastest angular version seems to fix this issue. (9.0.4)

The lastest angular version seems to fix this issue. (9.0.4)

Update to @ngx-translate/core v12.0.0 works for me

Issue resolved. Thanks!
@ngx-translate/[email protected] and @ngx-translate/[email protected] works fine on

$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.4
Node: 13.1.0
OS: linux x64

Angular: 9.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.4
@angular-devkit/build-angular     0.900.4
@angular-devkit/build-optimizer   0.900.4
@angular-devkit/build-webpack     0.900.4
@angular-devkit/core              9.0.4
@angular-devkit/schematics        9.0.4
@angular/cdk                      9.1.0
@angular/flex-layout              9.0.0-beta.29
@angular/material                 9.1.0
@ngtools/webpack                  9.0.4
@schematics/angular               9.0.4
@schematics/update                0.900.4
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2


Was this page helpful?
0 / 5 - 0 ratings