-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
TypeError: Cannot read property 'forEach' of undefined #490
Comments
Are you able to post a stats file that causes this issue? It's possible that some presence checks are needed where we use |
I don't think it would be possible, since it's a proprietary codebase 😕 |
But if it helps in any way we're exporting an array. When returning an array we're getting If I had to take a shot I would assume these lines are problematic: |
We can't fix it unless we can make a test case. Otherwise we're likely to break the fix in a future release if we don't have test coverage. |
I completely understand, but I think that more explicit errors can be very helpful, for example check if
Is very cryptic, and doesn't even help me understand if there's an issue with this package, my config, or something else. |
That is an error that merely comes because something is Without a stats JSON file, we don't know what is undefined and we can't write tests that would ensure we don't regress any error message feature or a test fix in the future. |
Here's a |
hi. here's a stats.json file that produces this error, using latest webpack, webpack-cli, webpack-bundle-analyzer:
|
Probably the problem is with the stats.json file and what is declared on webpack file that will generate json file. here you can find the possible configurations for stats conf. Maybe with a 'normal' config the problem should be gone...
|
Any updates on this? This is still an issue in the latest lib version, and it makes it unusable. |
If someone is able to create a pull request that reproduces this case with a test case and also fixes it then I'll consider accepting it |
@valscion Don't know about a fix, but both @ilias-t and @thecristen provided Zip files with a reproducible error. |
Yes, I asked about a reproduction as a test case and creating a pull request that aims to fix this bug. I don't have time right now to tackle this and it seems that this isn't affecting too many people right now. The quickest way to get this fixed is to help in fixing it as part of open source |
Ok, so as an alternative, use source-map-explorer...
|
Issue description
When running the CLI on a stats file (not all stats files, just some), I'm getting the following error, and the following error only:
It's not a lot to go on, there aren't any helpful hints or file names in which it crashes.
Technical info
Debug info
Using the CLI -
npx webpack-bundle-analyzer@latest stats.json
, with the following plugins:@sentry/webpack-plugin
terser-webpack-plugin
webpack-manifest-plugin
mini-css-extract-plugin
terser-webpack-plugin
webpack.ContextReplacementPlugin
webpack.DefinePlugin
The text was updated successfully, but these errors were encountered: