Skip to content

Terser v3.16.0 breaks terser-webpack-plugin #66

@pitops

Description

@pitops

The latest terser update (released an hour ago) breaks this plugin.

  • Operating System:
  • Node Version: 10.12.0
  • NPM Version: 6.4.1
  • webpack Version: 4.29.0
  • terser-webpack-plugin Version: 1.2.1

Expected Behavior

Terser to minify my code

Actual Behavior

ERROR in js/main.6e4faa1e7d31caf0fa3b.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/<path>/node_modules/terser-webpack-plugin/dist/minify.js:175:23)

How Do We Reproduce?

Delete yarn.lock

Install terser-webpack-plugin and try to run a production build where the plugin is called

workaround

As a workaround for now if you use yarn you can add a resolution to a fixed terser version. Delete yarn.lock first and node_modules

Example (in your package.json)

"resolutions": {
  "terser": "3.14.1"
}

For npm try the suggestion by @odedi

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