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

UnhandledPromiseRejectionWarning: TypeError: sirv is not a function #528

Closed renzp94 closed 1 year ago

renzp94 commented 1 year ago

Issue description

...

Technical info

  System:
    OS: macOS 12.5.1
    CPU: (8) x64 Apple M1 Pro
    Memory: 37.52 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.18.2 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 6.14.15 - /usr/local/bin/npm
    Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman

Debug info

"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",

(node:20919) UnhandledPromiseRejectionWarning: TypeError: sirv is not a function at Object.startServer at BundleAnalyzerPlugin2.startAnalyzerServer

import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'

webpackChain.plugin('webpack-bundle-analyzer').use(BundleAnalyzerPlugin)
valscion commented 1 year ago

I've never seen this webpackChain.plugin(...).use() format, where does it come crom? Can you test whether this error happens without the webpack chain usage?

renzp94 commented 1 year ago

I've never seen this webpackChain.plugin(...).use() format, where does it come crom? Can you test whether this error happens without the webpack chain usage?

I can use the webpack is ok. It may be the problem that I use the webpack chain.

renzp94 commented 1 year ago

I can delete the node_modules and download it again. It may be that there is a problem with the dependency. Sorry to bother you.