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

UglifyJsMinify - Terser Plugin Seems not working from 17 July 24 onwards #609

Open
Shashikant-Kew opened this issue Jul 31, 2024 · 5 comments

Comments

@Shashikant-Kew
Copy link

Webpack 5 version
Terser webpack plugin

Bug report

UglifyJsMinify - Terser Plugin Seems not working from webpack

Actual Behavior

Built files are not running properly. Crashing page.

Expected Behavior

Plugin should minify and code files

How Do We Reproduce?

Add Terser Plugin in webpack config
Minify option as UglifyJsMinify
Build on non prod server.
Access appliction.
Recieved files are giving error as
Uncaught Typeerror: can not read properties of undefined (reading bind)

Please paste the results of npx webpack-cli info here, and mention other relevant information

@Shashikant-Kew
Copy link
Author

Shashikant-Kew commented Jul 31, 2024

@Shashikant-Kew Shashikant-Kew changed the title UglifyJsMinify - Terser Plugin Seems not working UglifyJsMinify - Terser Plugin Seems not working from 17 July 24 onwards Jul 31, 2024
@alexander-akait
Copy link
Member

alexander-akait commented Jul 31, 2024

Please create reproduction test repo, we have a lot of tests and everything is fine

@Shashikant-Kew
Copy link
Author

Yes but there was no change which would cause it in our repo. We retested reverting all change. Only when we remove plugin it works. Earlier it was fine. No issue. Only after 17/18 July It started giving errors.

@alexander-akait
Copy link
Member

Please create reprducible test repo, I can't help you without more information

@jsilvawbc
Copy link

Hi.

@Shashikant-Kew Are you using package-lock files? If not, then your dependencies may get unexpectedly updated.

I am analyzing an issue with memory leaks that started happening when we moved our project from webpack 4 to webpack 5.

I see terser-webpack-plugin specifies any version of uglify-js supported:

    "node_modules/terser-webpack-plugin": {
      "version": "5.3.10",
      "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz",
      "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@jridgewell/trace-mapping": "^0.3.20",
        "jest-worker": "^27.4.5",
        "schema-utils": "^3.1.1",
        "serialize-javascript": "^6.0.1",
        "terser": "^5.26.0"
      },
      "engines": {
        "node": ">= 10.13.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/webpack"
      },
      "peerDependencies": {
        "webpack": "^5.1.0"
      },
      "peerDependenciesMeta": {
        "@swc/core": {
          "optional": true
        },
        "esbuild": {
          "optional": true
        },
        "uglify-js": {
          "optional": true
        }
      }
    },

My project does run. We have this version installed:

    "uglify-js": {
      "version": "3.8.0",
      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.8.0.tgz",
      "integrity": "sha512-ugNSTT8ierCsDHso2jkBHXYrU8Y5/fY2ZUprfrJUiD7YpuFvV4jODLFmb3h4btQjqr5Nh4TX4XtgDfCU1WdioQ==",
      "requires": {
        "commander": "~2.20.3",
        "source-map": "~0.6.1"
      }
    },

I'll be writing if I find out more. This may be a clue where to start: https://github.com/mishoo/UglifyJS/releases

Jul 17 v3.19.0 very suspicious!

Jun 10 v3.18.0 could work?

Oct 23, 2022 v3.17.4 I think the most stable, but untested.

Kind regards. Thank you.

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

3 participants