Stats file generated by ng build --stats-json cannot be parsed by analyzers
See original GitHub issueVersions
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
Desired behavior
File should be parsed by the analyzer.
Mention any other details that might be useful (optional)
Another place where it’s broken:
-
Upload the file
dist/test-app/stats.json
to https://webpack.github.io/analyse/ -
The file does not get parsed by https://webpack.github.io/analyse/
-
An error appears in the console:
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:
- Created 5 years ago
- Reactions:31
- Comments:17 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I confirm. Same problem. Webpack bundle analyzer not working in Angular 6
Thanks @tmakin - confirmed it works:
Or just install the latest version globally:
Probably good to keep the issue open until webpack.github.io/analyse works too.