FormidableLabs / webpack-dashboard

A CLI dashboard for webpack dev server
MIT License
13.87k stars 363 forks source link

Bug: "Success" status overwritten and stuck in "Compiling" for finished webpack build. #321

Closed SoxPan closed 3 years ago

SoxPan commented 3 years ago

Please provide a description of the bug / issue, and provide the details below:

Progress is 100% but status is still Compiling

If the issue is visual, please provide screenshots here
Screen Shot 2021-01-25 at 9 14 31 PM

====================================================================

Steps to reproduce the problem

Just running webpack-dashboard --minimal -- webpack --config webpack.config.js command

Please provide a gist of relevant files
  1. https://gist.github.com/SoxPan/138cec681ab71e2219f60468c5b58dcb
  2. https://gist.github.com/SoxPan/6e064d6d7ee301497d734e56b475c4b7
More Details
ryan-roemer commented 3 years ago

Update: Nevermind, I misread the issue. We're investigating 😛

ryan-roemer commented 3 years ago

Confirmed. At least in webpack5 there's some incorrect interplay with webpack.ProgressPlugin reporting more status after hooks.done fires. Debug logs for our repo dev command yarn dev:

TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.95, msg: 'emitting' 
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.98, msg: 'emitting' 
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.98, msg: 'emitting' 
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: 'done'     
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: 'done'     
TODO hook.done  status: 'Success'         
# ... webpack stuff snipped ...                                       
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: 'done'     
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: ''         
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: 'cache' 
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: 'cache' 
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: 'cache' 
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 0.99, msg: 'cache' 
TODO webpack.ProgressPlugin  status: 'Compiling', percent: 1, msg: ''         

We can probably use some threshold of percent and/or just straight msg to special case not having ProgressPlugin overwrite a Success (or possibly other) status.