question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng build --prod: Cannot read property '_walk' of null

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Node: v8.11.1 NPM: 6.4.1

Angular CLI: 6.2.3 Node: 8.11.1 OS: win32 x64 Angular: 6.1.9 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.8.3 @angular-devkit/build-angular 0.8.3 @angular-devkit/build-optimizer 0.8.3 @angular-devkit/build-webpack 0.8.3 @angular-devkit/core 0.8.3 @angular-devkit/schematics 0.8.3 @angular/cli 6.2.3 @ngtools/webpack 6.2.3 @schematics/angular 0.8.3 @schematics/update 0.8.3 rxjs 6.3.3 typescript 2.7.2 webpack 4.20.2

Windows 10

Repro steps

execute “ng build --prod” -> sorry, I can’t provide the repo.

This bug suddenly popped up on our build server two days ago. Before that, this problem never occurred. After cleaning node_moduls and npm install I can reproduce the error on my machine too.

The log given by the failure

`Date: 2018-09-28T18:28:46.879Z Hash: 2fa0d73885177ad3220b Time: 109957ms chunk {0} runtime.ec2944dd8b20ec099bf3.js (runtime) 1.44 kB [entry] [rendered] chunk {1} main.85d86102e68c1db8c7c4.js (main) 8.08 MB [initial] [rendered] chunk {2} polyfills.c2c353082061f41763b0.js (polyfills) 98.3 kB [initial] [rendered] chunk {3} styles.c5267d72f9cea9ab11f3.css (styles) 150 kB [initial] [rendered]

ERROR in main.85d86102e68c1db8c7c4.js from UglifyJs TypeError: Cannot read property ‘_walk’ of null at AST_Dot.eval (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1112:29) at TreeWalker._visit (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1513:21) at AST_Dot._walk (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1111:24) at AST_VarDef.eval (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1058:40) at TreeWalker._visit (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1513:21) at AST_VarDef._walk (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1056:24) at AST_Var.eval (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:966:32) at TreeWalker._visit (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1513:21) at AST_Var._walk (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:963:24) at walk_body (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:513:17) at AST_Function.eval (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:739:13) at TreeWalker._visit (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:1513:21) at AST_Function._walk (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:733:24) at AST_Function.walk (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:467:21) at get_lvalues (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:8804:34) at collapse (eval at <anonymous> (E:\jenkins\ProjectX\workspace\node_modules\uglifyjs-webpack-plugin\node_modules\uglify-es\tools\node.js:21:1), <anonymous>:8565:35) Build step ‘Execute Windows batch command’ marked build as failure [TASKS] Skipping publisher since build result is FAILURE Skipped archiving because build is not successful`

Desired functionality

Build optimization with uglifyjs works as before

Mention any other details that might be useful

Similar errors are filed for ember-cli: https://github.com/ember-cli/ember-cli/issues/8075

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

13reactions
DingWeizhecommented, Oct 9, 2018

If your project have a dependency tether, Try downgrade the version to 1.4.3.

https://github.com/HubSpot/tether/issues/291

1reaction
paustintcommented, Nov 2, 2018

@seanzhu0925 I updating everything, I can’t fix this issue with @angular/compiler-cli. Could someone describe in details how to avoid this issue during ng build --prod? (not locally but on CI server)? This is blocking issue for me. I can’t deploy application.

@inpicksys - my issue was that @angular-devkit/build-angular was not updated with ng update and I missed this, so I was still not using terser.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`ng build --prod` fails with `ERROR in TypeError: Cannot read ...
To solve the issue, I placed a console.log(maxMetadata.version); on line 66 of the metadata_reader.js and was able to get a lead to where ......
Read more >
typeerror: cannot read property 'descendant' of undefined
TypeError : Cannot read properties of undefined (reading 'Descendant') I have a React.js application which I have a Dockerfile and both the app...
Read more >
ng build - Angular
Option Description Value Type Default Value ‑‑aot Build using Ahead of Time compilation. boolean true ‑‑base‑href Base url for the application being built. string ‑‑delete‑output‑path Delete...
Read more >
Toolips ng build –prod error - MDBootstrap
p>when I was trying to build production of my project we got this error:</p> <p>in Error: TypeError: Cannot read property 'kind' of undefined<br...
Read more >
Angular 8 Webpack Aot Build Failed - Cannot Read Property ...
If you're using a library affected by this error, you should upgrade your @angular/cli version to 8 or disable optimization in production mode...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found