-
-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: Cannot create a string longer than 0x1fffffe8 characters #492
Comments
Oh wow, I've never seen an error like that 😅 sounds like something is generating an awfully long string 😅 I don't know even where to start to fix this. Would you be open to do some googling and figure out if this error has showed up elsewhere and if there might be some common code patterns that might cause this error? |
I think the reason is |
I think here are the problematic code: webpack-bundle-analyzer/src/analyzer.js Lines 164 to 168 in e5b617e
Maybe there is some package that parses JSON without reading it into a string first. @sokra maybe you've already solved such problem? |
I'll try stream-json. Seems like this lib can do it but it takes too long. I started parsing 30 minutes ago and it's still running Also i will try how works the webpack plugin with it |
It's finished and it takes ~30 minutes just to parse this json. Also i've tried the webpack plugin and it works fine |
Hi, |
@sushantmakin Webpack plugin works fine for me https://github.com/webpack-contrib/webpack-bundle-analyzer#usage-as-a-plugin |
Is there a solution to this? We also have a very large stats.json file that is failing when trying to analyze it. |
@tgudroe the webpack plugin works fine |
Does that mean the CLI can't be used in my case and there is no hope of it working in the future? |
@tgudroe I'll take a look at this later. Maybe we can fix it by replacing |
When I upload the same stats.json to http://chrisbateman.github.io/webpack-visualizer/ I'm seeing this error. Is this related?
|
Hello, |
Same issue. Hope this can be fixed. |
The workaround is to use the plugin and not CLI |
I knew that. But sometimes I need to compare the dependency graph between branches. It takes time to switch branch, install dependency and build the project. In this case, it's much more convenient to leverage the existing stat.json |
This should now be fixed in v4.8.0 thanks to #423! 🚀 Feel free to take it for a spin and let us know if the issue wasn't solved with that PR as expected. |
Hello, Thank you for the fix. |
Issue description
We have front-end heavy application with ~40 entry points and i want to optimize build size
Technical info
Debug info
How do you use this module? As CLI utility or as plugin?
If CLI, what command was used? (e.g.
webpack-bundle-analyzer -O path/to/stats.json
)If plugin, what options were provided? (e.g.
new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true })
)What other Webpack plugins were used?
It would be nice to also attach webpack stats file.
It can be generated using these options:
stats.json
will be created in Webpack bundle output directory.The text was updated successfully, but these errors were encountered: