'react-static build' fails when bundleAnalyzer is true
See original GitHub issueReproduce
react-static create
- select the basic template and enter
- set bundleAnalyzer:true in static.config.js
yarn build
then, errors can be seen in the console
$ react-static build
=> Copying public directory...
=> [✓] Public directory copied: 1.283ms
=> Building Routes...
=> [✓] Routes Built: 748.612ms
=> Bundling App...
Webpack Bundle Analyzer is started at http://127.0.0.1:8888
Use Ctrl+C to close it
=> [✓] App Bundled: 5106.728ms
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8888
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at doListen (net.js:1501:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
error Command failed with exit code 1.
react-static version: 4.8.1 node version: 8.9.4 Webpack Bundle Analyzer seems to run twice.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Solution: webpack-bundle-analyzer without ejecting. #3518
Ejecting is a real shame for any instance of create-react-app, so I found a way to use webpack-bundle-analyzer without ejecting.
Read more >Webpack bundle analyzer: Need an appropriate loader to ...
I'm new to webpack and I'm trying to install Webpack Bundle Analyzer on my project and I'm getting this error.
Read more >Create an Error Boundary for a React App | egghead.io
Uncaught errors in React used to leave your app in a corrupted state, since React ... Analyze a Production JavaScript Bundle with webpack-bundle-analyzer....
Read more >Command Line Interface - webpack
Build. Run webpack (default command, can be omitted). ... --analyze, boolean, It invokes webpack-bundle-analyzer plugin to get bundle information ...
Read more >How to use Webpack with React: an in-depth tutorial - Medium
Learn Webpack to create your own configurations for React. Including React Router, HMR, Code Splitting, production configuration and more.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i ran into this previously. we should only be doing bundle analyzer when stage === ‘prod’ ~ since stage === ‘node’ doesn’t matter so much.
should be
config.bundleAnalyzer && !isNode ? new BundleAnalyzerPlugin() : null
im in a fork right now, i’ll update it
sorry, I was so busy these days. I found that I could solve the problem by changing the analyzerMode of BundleAnalyzerPlugin from ‘server’ to ‘static’. so, I close this issue now.