← All tasks
javascriptwebpack/minimizer-webpack-plugin #437Not a task: already works

Constructor type error in 5.2.0

envgap__webpack__minimizer-webpack-plugin-437

01 / FAILURE SIGNATURE

As reported upstream

Using the plugin throws a typescript type error as of version 5.2.0:
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
0aadf7e1052fe5d719b9dcae8fa7c4793d0bcc97
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

webpack/minimizer-webpack-plugin #437 · read the original issue
<!-- Please don't delete this template otherwise your issue will be closed immediately -->

<!-- Before creating an issue please make sure you are using the latest version of webpack. -->



### Bug report



<!-- Please ask questions on discussions, StackOverflow or the webpack Gitter. -->

<!-- https://github.com/webpack/webpack/discussions -->

<!-- https://stackoverflow.com/questions/ask?tags=webpack -->

<!-- https://gitter.im/webpack/webpack -->

<!-- Issues which contain questions or support requests will be closed. -->



### Actual Behavior



Using the plugin throws a typescript type error as of version 5.2.0:

```

error TS2351: This expression is not constructable.

  Type 'typeof import("/Users/user/app/node_modules/terser-webpack-plugin/types/index")' has no construct signatures.



259       minimizer: [new TerserPlugin()]

```



<!-- Explain exactly how it behave -->



### Expected Behavior



Does not throw an error for documented usage



### How Do We Reproduce?



Simply using it as documented

```js

// @ts-check

const TerserPlugin = require('terser-webpack-plugin')



module.exports = {

  optimization: {

    minimize: true,

    minimizer: [new TerserPlugin()]

  }

}

```

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]