Skip to content
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

Big stats file cannot be loaded via fs function #3195

Closed
Yexiaoxing opened this issue Mar 20, 2023 · 2 comments
Closed

Big stats file cannot be loaded via fs function #3195

Yexiaoxing opened this issue Mar 20, 2023 · 2 comments

Comments

@Yexiaoxing
Copy link

If any of the generated webpack stats file is bigger than 500M, the built-in fs.readJSON does not work, and throw error:

Cannot create a string longer than 0x1fffffe8 characters

A possible fix is like webpack-contrib/webpack-bundle-analyzer#423 which uses a chunked method to load the JSON.

Similar issue: webpack-contrib/webpack-bundle-analyzer#492

@vio
Copy link
Member

vio commented Mar 22, 2023

@Yexiaoxing, thanks for opening the issue! The error has been shared before, and I plan to add support for large files on the next major version (#2118).

Until then, I recommend optimizing the webpack stats output. You can follow this guide to output only the data required by bundle-stats: https://relative-ci.com/documentation/guides/webpack-stats/webpack-stats-plugin/#optimize-the-webpack-stats-json-file-size.

If you get the chance to use the filter, will be great to hear how much the output changed. In the past, i noticed 90% decreases.

@vio
Copy link
Member

vio commented Mar 22, 2023

duplicate of #2118

@vio vio closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants