Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting stats.all to false causes watch to never finish compile #12976

Closed
maclockard opened this issue Mar 24, 2021 · 4 comments
Closed

Setting stats.all to false causes watch to never finish compile #12976

maclockard opened this issue Mar 24, 2021 · 4 comments

Comments

@maclockard
Copy link

Bug report

What is the current behavior?

If you set stats.all to false in the webpack config causes watch to never properly indicate it has finished a compile and prevents webpack from picking up future changes.

Additionally, this affects other tools like webpack-dev-server, preventing them from ever becoming available since they don't think webpack has completed the initial compilation.

Related: #12748

If the current behavior is a bug, please provide the steps to reproduce.

Reproduction: https://github.com/maclockard/webpack-5-stats-no-exit

Run the following commands after cloning to reproduce:

  • yarn
  • yarn repro

You will see that webpack never prints out webpack 5.28.0 compiled successfully and does not pick up any further changes to ./index.js.

If you run yarn no-repro instead everything works as expected.

What is the expected behavior?

Webpack when watching indicates when it has finished the initial compile, and picks up further changes. Additionally, it lets webpack-dev-server know it has completed so that it can become available.

Other relevant information:
webpack version: 5.28.0
Node.js version: 12.19.1
Operating System: macOS 11.2
webpack-cli version: 4.5.0

@webpack-bot
Copy link
Contributor

For maintainers only:

  • webpack-4
  • webpack-5
  • bug
  • critical-bug
  • enhancement
  • documentation
  • performance
  • dependencies
  • question

@alexander-akait
Copy link
Member

alexander-akait commented Mar 25, 2021

No bugs all: false all output, maybe you need this webpack/webpack-cli#2374, feel free to feedback, you can see output using:

stats: {
    all: false,
    version: true,
    errorsCount: true,
    warningsCount: true,
},

@maclockard
Copy link
Author

maclockard commented Mar 25, 2021

@alexander-akait it prevents more than just output. It also prevents webpack watch from picking up future changes and it prevents webpack-dev-server from starting.

Nvm, I'm wrong. unsure why I was seeing that before then.

@MarvinXu
Copy link

I am having a similar issue: the build finishes, but never exits the shell. I want to know what in the webpack core could have caused this problem?

My webpack config:

const path = require('path');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');

const config = require('./config');

module.exports = {
  mode: 'production',
  entry: {
    app: ['./src/index.js']
  },
  output: {
    path: path.resolve(process.cwd(), './lib'),
    publicPath: '/dist/',
    filename: 'element-ui.common.js',
    chunkFilename: '[id].js',
    libraryExport: 'default',
    library: 'ELEMENT',
    libraryTarget: 'commonjs2'
  },
  resolve: {
    extensions: ['.js', '.vue', '.json'],
    alias: config.alias,
    modules: ['node_modules']
  },
  externals: config.externals,
  performance: {
    hints: 'false'
  },
  stats: {
    children: false
  },
  optimization: {
    minimize: false
  },
  module: {
    rules: [
      {
        test: /\.(jsx?|babel|es6)$/,
        include: process.cwd(),
        exclude: config.jsexclude,
        loader: 'babel-loader'
      },
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: {
          compilerOptions: {
            preserveWhitespace: false
          }
        }
      },
      {
        test: /\.css$/,
        loaders: ['style-loader', 'css-loader']
      },
      {
        test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
        loader: 'url-loader',
        query: {
          limit: 10000,
          name: path.posix.join('static', '[name].[hash:7].[ext]')
        }
      }
    ]
  },
  plugins: [
    new ProgressBarPlugin(),
    new VueLoaderPlugin()
  ]
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants