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.json messed up with outputs from webpackbar

See original GitHub issue

First of all, thanks so much for this wonderful progress bar.

I was using webpackbar and tried to write a stats.json file to be used by webpack-bundle-analyzer.

Here’s my npm script:

webpack --env=production --profile --json > stats.json

However, stats.json contains some output from webpackbar. Here’s how it looks like:

ℹ Compiling Webpack                                        webpackbar 18:06:57
✔ Webpack: Compiled successfully in 3.22s                  webpackbar 18:07:00
{
  "errors": [],
  "warnings": [],
  "version": "4.29.3",
  "hash": "ed64caf72379ba267639",
  "time": 3228,
  "builtAt": 1549976820840,
  "publicPath": "/",
  "outputPath": "/Users/shahzaib/my-stuff/serious-projects/testing-shaizei/copy-jetsetter/build",
  "assetsByChunkName": {
    "main": [
    // remaining file is not included for brevity
}

Due to these two lines (in the start), stats.json is becoming invalid.

Any workaround for this?

<div align="right">This question is available on Nuxt community (#c33)</div>

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

6reactions
thasmocommented, May 10, 2019

When using the --json flag via webpack-cli the webpackbar plugin should not output …

webpackbar 13:14:00 ℹ Compiling Webpack
webpackbar 13:14:04 ✔ Webpack: Compiled successfully in 3.40s

… because it makes the JSON output invalid.

Will this issue be worked on in the future or are there any reasons it has not been closed yet? Thanks!

3reactions
Airkrocommented, Aug 20, 2020

Countless plugins use the console API. So I think any output from the terminal is untrustworthy, I don’t recommend using whatever --foo --bar > files.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

stats.json messed up with outputs from webpackbar · Issue #42
I was using webpackbar and tried to write a stats.json file to be used by ... stats.json messed up with outputs from webpackbar...
Read more >
Error reading webpack-stats.json - Stack Overflow
I have made a docker file to try to replicate the environment and I have even pushed the image to docker hub ....
Read more >
Build Analysis - SurviveJS
Analyzing build statistics is a good step towards understanding webpack better. ... If you want JSON output from stats , use stats.toJson() ....
Read more >
ProgressPlugin - webpack
The ProgressPlugin provides a way to customize how progress is reported during a compilation. Usage. Create an instance of ProgressPlugin and provide one...
Read more >
Lessons Learned From a Year of Fighting With Webpack and ...
stats : 'minimal' }. 2. Add WebpackBar to get much less-verbose, friendlier, and more concise output. Note: The first configuration is meant ...
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