Skip to content

[webpack-dev-middleware] ConcurrentCompilationError: You ran Webpack twice. Each instance only supports a single concurrent compilation at a time. #4947

Closed
@gonandriy

Description

@gonandriy

Bug report

Actual Behavior

If I export multiple configurations, as described here
https://webpack.js.org/configuration/configuration-types/#exporting-multiple-configurations
and run webpack serve
I see this error
image

And watching for files changing does not work!

webpack.config.js is very simple

const path = require('path');

module.exports = [
  {
    mode: 'development',
    entry: './src/index.js',
    output: {
      filename: 'main.js',
      path: path.resolve(__dirname, 'dist/default/'),
    },
    devtool: 'inline-source-map',
    devServer: {
      static: './dist/default',
    },
  },
  {
    mode: 'development',
    entry: './src/admin.js',
    output: {
      filename: 'admin.js',
      path: path.resolve(__dirname, 'dist/admin/'),
    },
    devtool: 'inline-source-map',
    devServer: {
      static: './dist/admin',
    },
  }
];

Expected Behavior

The webpack dev server is running and watches after file changing and always serve the most recent compiled content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions