Skip to content

Regression in 5.110.0 with esbuild-loader: "ERROR: "minify" must be a boolean" #21879

Description

@ahukkanen

Have you used AI?

No

Which part of webpack is affected?

optimization (tree-shaking, splitChunks, concatenation)

Bug Description

When trying to build JS with the EsbuildPlugin from esbuild-loader, the following error is displayed:

ERROR: "minify" must be a boolean

This happens with the following configuration:

const { EsbuildPlugin } = require("esbuild-loader");

module.exports = {
  mode: "production",
  entry: "./index.js",
  optimization: {
    minimizer: [
      new EsbuildPlugin({
        // minify: true, // <-- fix commented out
        target: "es2015",
        css: true,
      }),
    ],
  },
};

Link to Minimal Reproduction and steps to reproduce

$ mkdir webpack-eslint-loader-bug && cd webpack-eslint-loader-bug
$ npm init -y
$ npm i -D webpack@5.110.0 webpack-cli esbuild esbuild-loader
$ echo 'console.log("Hello");' > index.js
$ cat <<-CONF > webpack.config.js
const { EsbuildPlugin } = require("esbuild-loader");

module.exports = {
  mode: "production",
  entry: "./index.js",
  optimization: {
    minimizer: [
      new EsbuildPlugin({
        // minify: true,
        target: "es2015",
        css: true,
      }),
    ],
  },
};
CONF
$ sed -i -E 's/("scripts": \{)/\1\n    "build": "webpack",/' package.json
$ npm run build

Expected Behavior

The build to work correctly.

Actual Behavior

Error: ERROR: "minify" must be a boolean

Environment

System:
 - OS: (irrelevant)
 - CPU: (irrelevant)
 - Memory: (irrelevant)
Binaries:
 - Node: 24.18.1 - /usr/local/bin/node
 - Yarn: 1.22.19 - /usr/local/bin/yarn
 - npm: 11.16.0 - /usr/local/bin/npm
Browsers:
 - Chrome: (irrelevant)
 - Firefox: (irrelevant)
 - Firefox Developer Edition: (irrelevant)
Packages:
 - esbuild-loader: ^4.5.0 => 4.5.0 
 - webpack: ^5.110.0 => 5.110.0 
 - webpack-cli: ^7.2.3 => 7.2.3

Is this a regression?

Yes (please specify version below)

Last Working Version

v5.109.2

(broken in v5.110.0)

Additional Context

If you uncomment the minify: true, configuration in the sample configuration it works.

It also works with webpack v5.109.2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: configOptions, defaults, validation (lib/config, schemas/)area: optimizationTree-shaking, splitChunks, concatenation, ids (lib/optimize, lib/ids)regressionWorked in a previous release; pair with the Affected version field

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo