[4.0.0-beta.3] exiting webpack-dev-server process logs "99% end closing watch compilation" in terminal
See original GitHub issueHello,
I have a webpack configuration using among other things:
- webpack v5.38
- html-webpack-plugin v5.3
- webpack-dev-server v4.0.0 (beta.3, but I also experienced it with beta.2)
The dev server works fine, including HMR. However whenever I exit the process (using ctrl+c), it logs a warning in the terminal (cannot figure out where it comes from, but my current thoughts points to this project, hope it is not my environment…)
- This is a bug
- This is a modification request
Code
// webpack.config.babel.js
// simplified extract: https://github.com/flo-sch/webpack-dev-server-issue-close-compilation/blob/master/webpack.config.babel.js
const coreConfiguration = {
module: {
rules: [
{
test: /\.[tj]sx?$/,
use: [
{
loader: 'babel-loader'
}
],
exclude: /node_modules/
}
// ...
]
},
plugins: [
// ...
new HtmlWebpackPlugin({
template: path.resolve(SRC_FOLDER, 'index.html'),
path: BUILD_FOLDER,
filename: 'index.html',
// ...
}),
],
optimization: {
splitChunks: {
chunks: 'all'
}
},
stats: {
preset: 'normal',
env: true,
errorDetails: true
}
};
const developmentConfiguration = merge(coreConfiguration, {
mode: 'development',
output: {
clean: true,
chunkFilename: '[name].chunk.js',
crossOriginLoading: 'anonymous',
filename: '[name].js',
path: BUILD_FOLDER,
publicPath: '/'
},
devtool: 'cheap-module-source-map',
devServer: {
// ...
host: process.env.DEV_SERVER_HOST || 'localhost',
port: process.env.DEV_SERVER_PORT || 1234,
static: [
{
directory: BUILD_FOLDER,
publicPath: '/',
serveIndex: true,
watch: true
}
]
},
// ...
optimization: {
emitOnErrors: false,
minimize: false,
moduleIds: 'named'
},
performance: {
hints: 'warning'
}
});
const getWebpackConfiguration = (_env, args) => {
const { mode } = args;
switch (mode) {
case 'development':
return developmentConfiguration;
case 'production':
return productionConfiguration;
default:
throw new Error(`Unable to provide configuration for unknown environment: "${mode}"`);
}
};
export default getWebpackConfiguration;
// package.json
{
"scripts": {
"dev": "cross-env BABEL_ENV=webpack NODE_ENV=development webpack serve --mode development --config webpack.config.babel.js --progress --open"
// ...
}
}
Please paste the results of webpack-cli info
here, and mention other relevant information
➜ npx webpack-cli info
System:
OS: macOS 11.4
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
Packages:
compression-webpack-plugin: ^8.0.0 => 8.0.0
copy-webpack-plugin: ^9.0.0 => 9.0.0
csp-html-webpack-plugin: ^5.1.0 => 5.1.0
dotenv-webpack: ^7.0.0 => 7.0.3
html-webpack-plugin: ^5.3.1 => 5.3.1
image-minimizer-webpack-plugin: ^2.2.0 => 2.2.0
webpack: ^5.38.0 => 5.38.1
webpack-bundle-analyzer: ^4.4.0 => 4.4.2
webpack-cli: ^4.7.0 => 4.7.2
webpack-dev-server: ^4.0.0-alpha.3 => 4.0.0-beta.3
webpack-merge: ^5.8.0 => 5.8.0
webpack-subresource-integrity: ^5.0.0-alpha.5 => 5.0.0-alpha.5
workbox-webpack-plugin: ^6.1.0 => 6.1.5
Also perhaps worth mentioning that I use zsh?
➜ npx envinfo webpack
System:
OS: macOS 11.4
Shell: 5.8 - /bin/zsh
Expected Behavior
Nothing happen after exiting webpack-dev-server process
Actual Behavior
A last message is shown in the terminal, stating:
99% end closing watch compilation
For Bugs; How can we reproduce the behavior?
Checkout the reproduction repository:
https://github.com/flo-sch/webpack-dev-server-issue-close-compilation
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
can't close webpack-dev-server --progress with Ctrl + C #1479
Running the dev server with: yarn webpack-dev-server --progress . ... Ctrl+C exits the process but leaves the server running.
Read more >webpack-dev-server - npm
Start using webpack-dev-server in your project by running `npm i webpack-dev-server`. ... 4.0.0-beta.3 • Public • Published a year ago.
Read more >webpack-dev-server | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >How can I stop webpack dev server from windows console?
I run webpack devserver by issuing the "npm start" command. ... In my case CTRL+C did close the process on terminal but when...
Read more >Command Line Interface - webpack
Run webpack and watch for files changes. Build. Run webpack (default command, can be omitted). npx webpack build [options].
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 will look at this in near future
Yep, it is duplicate https://github.com/webpack/webpack-dev-server/issues/1479, bug on webpack side, I priority this, hope we will fix it for stable v4 release