You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugin crashes when trying to stringify a large stat blob #119
Not sure how big it starts to fail to be honest, but I don't think it's a massive number in terms of MB. It might make sense to adjust this plugin to use a streaming JSON stringifier and async write to disk to help overcome this?
Manifests itself commonly when using ModuleConcatenation on a webpack project with multiple entry points.
What kind of a crash are you seeing? Would it be possible for you to generate an example repository that is big enough to demonstrate this crash? It would help us in making sure that we've fixed the problem.
It’s Node running out of memory when calling JSON.stringify due to the size of the stats object.
Closed source and a big project, so I can’t share it unfortunately.
Closed source and a big project, so I can’t share it unfortunately.
That's why I said generate in "Would it be possible for you to generate an example repository". It would improve the possibility of getting this fixed in a reasonable time frame.
Ok, that's relieving to hear! I wasn't sure what part of the plugin crashed, but if it was just the stats stringifying, then this should be pretty straightforward to fix.
We're open to accept a PR fixing this. The code in question is this:
It should be OK to mark that function as async and await the completion of JSON stringify stream. Let me know if you need any help figuring things out and I'll help to the best of my knowledge!
Activity
valscion commentedon Oct 1, 2017
What kind of a crash are you seeing? Would it be possible for you to generate an example repository that is big enough to demonstrate this crash? It would help us in making sure that we've fixed the problem.
evan-scott-zocdoc commentedon Oct 1, 2017
valscion commentedon Oct 1, 2017
That's why I said generate in "Would it be possible for you to generate an example repository". It would improve the possibility of getting this fixed in a reasonable time frame.
hlehmann commentedon Oct 8, 2017
I have the same since recently, when I added ModuleConcatenationPlugin. I get a
Very long stringerror.Here the stack.
hlehmann commentedon Oct 8, 2017
No issue when using
generateStatsFile: falsevalscion commentedon Oct 9, 2017
Ohh, so this issue is only happening when you generate a
stats.jsonfile? And things work a-OK ifgenerateStatsFile: false, right?hlehmann commentedon Oct 9, 2017
absolutly it crashes with
generateStatsFile: truebut not withgenerateStatsFile: false. I have no issue to get the html report.current config:
valscion commentedon Oct 9, 2017
Ok, that's relieving to hear! I wasn't sure what part of the plugin crashed, but if it was just the stats stringifying, then this should be pretty straightforward to fix.
We're open to accept a PR fixing this. The code in question is this:
https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/e6fbbe78381821f95003a2bc248de1dfae08b2dc/src/BundleAnalyzerPlugin.js#L64-L72
It should be OK to mark that function as
asyncand await the completion of JSON stringify stream. Let me know if you need any help figuring things out and I'll help to the best of my knowledge!valscion commentedon Nov 6, 2017
@evan-scott-zocdoc and @hlehmann: Could you test PR #129 by @ryan953 on your local project to see if it fixes your issues?
...and then try to generate the stats file?
evan-scott-zocdoc commentedon Nov 6, 2017
@valscion just tried it out in our biggun project and it worked! Awesome job @ryan953, thanks!
valscion commentedon Feb 4, 2018
Fix by @ryan953 has been released in v2.10.0 🎉. Upgrading might be a good idea 😉