react-slingshot: Bundle analyzer Error: listen EADDRINUSE :::8888
Node version: v6.5.0
npm version: 3.10.3
Operating system: macos 10.12.1
Command line used: npm start
Steps to reproduce:
1, change some code under src. 2, save 3, Got the errmsg:
webpack: bundle is now VALID.
Unable to find bundle asset "/Users/jifeng/gitlab/cmbc/dist/bundle.js".
Analyzer will use module sizes from stats file.
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8888
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at Server._listen2 (net.js:1253:14)
at listen (net.js:1289:10)
at Server.listen (net.js:1385:5)
at EventEmitter.listen (/Users/jifeng/gitlab/cmbc/node_modules/webpack-bundle-analyzer/node_modules/express/lib/application.js:617:24)
at Object.startServer (/Users/jifeng/gitlab/cmbc/node_modules/webpack-bundle-analyzer/lib/viewer.js:57:14)
at BundleAnalyzerPlugin.startAnalyzerServer (/Users/jifeng/gitlab/cmbc/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:78:12)
at analyzeFn (/Users/jifeng/gitlab/cmbc/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:57:24)
at Timeout._onTimeout (/Users/jifeng/gitlab/cmbc/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:69:11)
at tryOnTimeout (timers.js:232:11)
at Timer.listOnTimeout (timers.js:202:5)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 30 (8 by maintainers)
Commits related to this issue
- Now the bundle analyzer runs its own script. Fixes #301. — committed to coryhouse/react-slingshot by deleted user 8 years ago
- Merge pull request #311 from coryhouse/bug/301 Now the bundle analyzer runs its own script. Fixes #301. — committed to coryhouse/react-slingshot by coryhouse 8 years ago
I got this to work by modifying the config options passed into the plugin:
new BundleAnalyzerPlugin({analyzerMode: 'static'})This launches the analyzer page against the generated data file rather than the bundle itself, and works well to get past the issue when using hot reloading.
Good luck!
This just means you already have something running on port 8888 (likely the same project, running in another window) 😃
I’m going to leave this here for anyone using Vue’s modern mode build with webpack’s BundleAnalyzerPlugin. Hope it helps someone 🥂
Problem I received this error when using the vue ui build task for production in
--modernmode. Because it generates a legacy build and a modern build. The webpack bundle analyzer plugin fails on the second build.Solution
Docs for modern mode Vue CLI v3 Modern Mode Link
Hrmm. I’ve reopened this to see if we can figure out a root cause. @iyel, if you specify a different port, does it work for you?
Here’s how:
Change this line to specify a port:
More info
Since I’m also falling into this old issue, I’ll also add my word:
webpack-bundle-analyzernow seems to be a dependency ofvue-cli-serviceSo I explicitely uninstalled it
And generated a report with
The report should now be generated in
src/build/report.htmlwell done。
looks like
new BundleAnalyzerPlugin()causes the error. By commenting the line https://github.com/coryhouse/react-slingshot/blob/master/webpack.config.dev.js#L41 there will be no crash and no analyzer