webpack-contrib / webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
MIT License
12.56k stars 483 forks source link

Doesn't automatically open browser window in WSL2 #498

Closed franklin-ross closed 1 year ago

franklin-ross commented 2 years ago

Issue description

When running the bundle analyser plugin in WSL2, specifying openAnalyzer: true doesn't actually open browsers. Everything else works great, I can manually open the URL and see the stats.

I believe this fails because the opener dependency doesn't support WSL: https://github.com/domenic/opener/issues/33. I believe swapping to an alternative that's actively maintained should solve this issue.

Technical info

  System:
    OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (10) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 3.93 GB / 9.72 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.9.1 - ~/.nvm/versions/node/v16.9.1/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.9.1/bin/yarn
    npm: 8.5.2 - ~/.nvm/versions/node/v16.9.1/bin/npm
  npmPackages:
    compression-webpack-plugin: ^9.2.0 => 9.2.0 
    html-webpack-plugin: 5.5.0 => 5.5.0 
    webpack: ^5.69.1 => 5.69.1 
    webpack-bundle-analyzer: ^4.5.0 => 4.5.0 
    webpack-cli: 4.9.2 => 4.9.2 
    webpack-dev-server: ^4.7.4 => 4.7.4 
    webpack-merge: ^5.8.0 => 5.8.0 

Debug info

How do you use this module? As CLI utility or as plugin? As a Webpack plugin

If plugin, what options were provided? No options, or with openAnlyser explicitly set to true.

What other Webpack plugins were used? A few, but I don't think they're relevant. I can provide them if I'm mistaken.

It would be nice to also attach webpack stats file. I don't think it's necessary for me to attach a stats file as that all works fine.