-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Fix missing child bundles throwing an error #378
Fix missing child bundles throwing an error #378
Conversation
@jsf-clabot rerun |
Thanks! Would you be able to setup a test with Those files are used by tests defined in https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/test/analyzer.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valscion let's not merge it without a test please.
👍 sounds good to me! |
@dabbott : It would be great if you can debug a bit deeper, my understanding is that we eliminate assets generated by plugins like HtmlWebpackPlugin in the regex/assetfilter (only js assets are analyzed). It looks like in your webpack config something with HtmlWebpackPlugin is generating js assets, can you share the config so I can understand the issue a bit better? |
@masterkidan Thanks for checking this out. Here's my webpack config: https://github.com/dabbott/react-native-web-player/blob/58e49839516a32a91267510b550823e644b72364/webpack/webpack.config.js. If you'd like, you should be able to pull down that |
@dabbott : I think this may be because of the fact your template is an 'ejs' file. This is not something that gets filtered out by the regex, but the template compilation is a child compilation, I think a slightly better way would be to check why
is not filtering out the asset, and fix it here instead :) . You can use https://github.com/masterkidan/worker-loader-no-stats as a base and add a simple index.ejs template with a WebpackHtlmPlugin to process it.... I am not sure when I will be able to get to it on my own. |
Ok! I was able to track this down. This happens when workers contain dynamic imports with I think this is probably in an OK state to merge, and @masterkidan if you have time you could do a better fix in the future. |
@dabbott so, what is the actual reason for the exception? What asset it tries to find but it's not there? |
We're looking for
That name doesn't exist in |
This fixes an issue introduced in #376, where
getChildAssetBundles
sometimes doesn't find the givenstatAsset.name
and returns undefined, which later causes an error.This probably isn't a great fix, and I'm not sure specifically how to reproduce the issue, but it seems harmless enough that I'll be using it for now at least 😅