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.

Stats file generated by ng build --stats-json cannot be parsed by analyzers

See original GitHub issue

Versions

Angular CLI: 6.0.0-rc.9
Node: 9.5.0
OS: darwin x64
Angular: 6.0.0-rc.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.12
@angular-devkit/build-angular     0.5.12
@angular-devkit/build-optimizer   0.5.12
@angular-devkit/core              0.5.12
@angular-devkit/schematics        0.5.12
@angular/cli                      6.0.0-rc.9
@ngtools/webpack                  6.0.0-rc.10
@schematics/angular               0.5.12
@schematics/update                0.5.12
rxjs                              6.0.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps

  • ng new test-app
  • cd test-app
  • ng build --stats-json
  • npx webpack-bundle-analyzer ./dist/test-app/stats.json

Observed behavior

image

Desired behavior

File should be parsed by the analyzer.

Mention any other details that might be useful (optional)

Another place where it’s broken:

Uncaught TypeError: Cannot read property 'sort' of undefined
    at r (web.js:1)
    at Object.e.load (web.js:1)
    at FileReader.e.onload (8.568a26e05565c8025a86.js:1)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:31
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
pumanocommented, May 6, 2018

I confirm. Same problem. Webpack bundle analyzer not working in Angular 6

6reactions
beemancommented, May 12, 2018

Thanks @tmakin - confirmed it works:

npx webpack-bundle-analyzer@latest ./dist/test-app/stats.json

Or just install the latest version globally:

npm i -g webpack-bundle-analyzer@latest

image

Probably good to keep the issue open until webpack.github.io/analyse works too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 6 build with --stats-json not generating stats.json file
My system requires to have "npm run" before every angular cli command. I've ran "npm run ng build --prod --stats-json" as well as...
Read more >
webpack-bundle-analyzer - npm
Start using webpack-bundle-analyzer in your project by running `npm i ... If true , webpack stats JSON file will be generated in bundle ......
Read more >
Stats Data - webpack
Stats Data. When compiling source code with webpack, users can generate a JSON file containing statistics about modules. These statistics can be used...
Read more >
Angular bundle optimization using Webpack Bundle analyzer ...
We take a look at two tools - Webpack Bundle analyzer /Sourcemap explorer - which can be used to optimize generated js bundle...
Read more >
Angular CLI — Demystifying the workspace - Nx Blog - Nrwl
The CLI ng new command creates a workspace to contain projects. ... As an example, we want to generate a stats.json file when...
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