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

webpack-bundle-analyzer displays a blank page when run from the CLI #367

Closed
divmgl opened this issue Jul 11, 2020 · 5 comments
Closed

webpack-bundle-analyzer displays a blank page when run from the CLI #367

divmgl opened this issue Jul 11, 2020 · 5 comments

Comments

@divmgl
Copy link

divmgl commented Jul 11, 2020

Issue description

Hello. When using the plugin the bundle analyzer displays everything correctly. However, I want to use a stats.json file that I'm generating with production flags on.

Unfortunately, the page is just completely blank.

Technical info

  System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 201.30 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.1 - /usr/local/bin/node
    npm: 6.14.5 - /usr/local/bin/npm
  npmPackages:
    koa-webpack: ^5.3.0 => 5.3.0
    terser-webpack-plugin: ^3.0.6 => 3.0.6
    webpack: ^4.42.0 => 4.43.0
    webpack-bundle-analyzer: ^3.8.0 => 3.8.0
    webpack-cli: ^3.3.12 => 3.3.12
    webpack-dev-server: 3.10.3 => 3.10.3
    webpack-hot-middleware: ^2.25.0 => 2.25.0
    webpack-merge: ^4.2.2 => 4.2.2
    webpack-node-externals: ^1.7.2 => 1.7.2
  npmGlobalPackages:
    webpack-bundle-analyzer: 3.8.0

Debug info

$ NODE_ENV=production `npm bin`/webpack \
  --config webpack.client.js \
  -o build/client/index.js \
  --profile --json > stats.json
$ webpack-bundle-analyzer stats.json

Screen Shot 2020-07-11 at 8 36 33 AM

stats.json.zip

@Igloczek
Copy link

Check your Webpack config file, seems like having stats: 'error-only' is causing the stats.json to have very limited output.

@divmgl divmgl closed this as completed Jul 17, 2020
@divmgl
Copy link
Author

divmgl commented Jul 17, 2020

Fantastic, thank you @Igloczek

@valscion
Copy link
Member

valscion commented Jul 17, 2020

Glad to see that the issue was solved with a configuration change ☺️. Would anyone be willing to add that information to the repository README.md, "Troubleshooting" section? See #370

@david-wolgemuth
Copy link

I'm also seeing a blank page. I don't have any stats: key for my webpack config.

some of the requirements we're using here:

'autoprefixer'
'path'
'webpack'
'html-webpack-plugin'
'mini-css-extract-plugin'
'optimize-css-assets-webpack-plugin'
'webpack-manifest-plugin'
'terser-webpack-plugin'
'react-dev-utils/InterpolateHtmlPlugin'
'sw-precache-webpack-plugin'
'react-dev-utils/eslintFormatter'
'react-dev-utils/ModuleScopePlugin'
'./paths'
'./env'
'compression-webpack-plugin'
'webpack-s3-plugin'
'fork-ts-checker-webpack-plugin'

Here's my stats file:

stats.json.zip

Help is appreciated! The gzipped build ballooned up to ~3MB over the last couple months 😅

@valscion
Copy link
Member

@david-wolgemuth it could be that compression-webpack-plugin is causing your issue, as #379 isn't yet done ☺️

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

No branches or pull requests

4 participants