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

Report page shows nothing but slide bar #244

Closed
s524797336 opened this issue Jan 24, 2019 · 8 comments
Closed

Report page shows nothing but slide bar #244

s524797336 opened this issue Jan 24, 2019 · 8 comments

Comments

@s524797336
Copy link

Issue description

Show empty page
Console show "No bundles were parsed. Analyzer will show only original module sizes from stats file"
Browser console show nothing

Technical info

  • Webpack Bundle Analyzer version:3.0.3
  • Webpack version:4.29.0
  • Node.js version:11.6.0
  • npm version:6.6.0
  • OS:mac

Debug info

I use this as plugin
Here is stats file stats.json.zip

@samkelleher
Copy link

Same issue, one caveat is that I'm using ESM .mjs files if that has any impact. A JS bundle is still created however.

@danoc
Copy link

danoc commented Mar 11, 2019

I also ran into this and did some debugging.

In my case, it was happening because we were gzipping our assets (with CompressionPlugin) which, from what I understand, changed the filenames from .js to js.gz.

The bundle analyzer removes all non-js or mjs files here:

// Picking only `*.js or *.mjs` assets from bundle that has non-empty `chunks` array
bundleStats.assets = _.filter(bundleStats.assets, asset => {
// Removing query part from filename (yes, somebody uses it for some reason and Webpack supports it)
// See #22
asset.name = asset.name.replace(FILENAME_QUERY_REGEXP, '');
return FILENAME_EXTENSIONS.test(asset.name) && !_.isEmpty(asset.chunks) && isAssetIncluded(asset.name);
});

As a workaround, I disable our gzipping when analyzing the bundle. I don't think this is an issue with webpack-bundle-analyzer.


@samkelleher — That was fixed 6 days ago in #252.

@valscion
Copy link
Member

valscion commented Apr 6, 2019

Thanks for providing the stats.json @s524797336. The critical parts look like this:

{
  "assets": [
  ],
  "children": [
    {
      "assets": [
        {
          "name": "__child-HtmlWebpackPlugin_0",
          "size": 711481,
          "chunks": [
            0
          ],
          "chunkNames": [
            "HtmlWebpackPlugin_0"
          ],
          "emitted": false
        }
      ]
    }
  ]
}

Because children[0].assets array's .name does not end up in .js or .mjs, webpack-bundle-analyzer skips parsing your entire bundle.

I don't know what causes the name to not have a .js ending, so I'm afraid I can't help you any further than this.

@s524797336
Copy link
Author

If i stop using gzip, this works fine, so i don't think this is what happened.

@sliebner
Copy link

sliebner commented Mar 5, 2020

I had the same issue. After quite some time I found out, that someone set stats: 'errors-only', in our webpack.config.js.

See https://webpack.js.org/configuration/stats/.

Using stats: 'normal solved it for me.

@RedVelocity
Copy link

anyone figured out a solution yet? sucks that it doesn't analyze gzipped bundles

@valscion
Copy link
Member

webpack-bundle-analyzer does support gzip. Please open a new issue to describe your situation in more detail @RedVelocity

@webpack-contrib webpack-contrib locked as resolved and limited conversation to collaborators Aug 27, 2020
@valscion
Copy link
Member

valscion commented Aug 27, 2020

Oh yeah, true, if you compress assets, turning output to gzip files, that indeed doesn't work. A new issue specifically about that feature missing would be helpful if anyone's willing to write up such an issue as a feature request ☺️

EDIT: Here's the new issue written by @RedVelocity 💞 #377

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants