Skip to content

TypeError with jquery #31

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

Closed
drkNsubuga opened this issue Jul 21, 2020 · 0 comments
Closed

TypeError with jquery #31

drkNsubuga opened this issue Jul 21, 2020 · 0 comments

Comments

@drkNsubuga
Copy link

drkNsubuga commented Jul 21, 2020

Summary

I get a TypeError when Jquery minified version is included in the source files yet I do see any errors without obfuscation.

Expected Behavior

No console errors are expected after obfuscation.

Current Behavior

This is the console log in Chrome

jquery-3.4.1.min.js:2 Uncaught TypeError: Object.defineProperty called on non-object
    at Function.defineProperty (<anonymous>)
    at SE.cache (jquery-3.4.1.min.js:2)
    at SE.get (jquery-3.4.1.min.js:2)
    at Object.add (jquery-3.4.1.min.js:2)
    at Number.<anonymous> (jquery-3.4.1.min.js:2)
    at Function.each (jquery-3.4.1.min.js:2)
    at Sm.fn.init.each (jquery-3.4.1.min.js:2)
    at GB (jquery-3.4.1.min.js:2)
    at Sm.fn.init.on (jquery-3.4.1.min.js:2)

A similar error is shown in firefox

Uncaught TypeError: Object.defineProperty called on non-object

Steps to Reproduce

  1. Upgrade to latest gulp-javascript-obfuscator
  2. Enable sourcemaps using 'gulp-sourcemaps'
  3. Add jquery-x.x.x.min.js to the src files

Environment

  • Package version used: v1.1.6
  • Node version used: v14.4.0

Minimal working example that will help to reproduce issue

const sourcemaps = require('gulp-sourcemaps');
const javascriptObfuscator = require('gulp-javascript-obfuscator');

gulp.src('jquery-3.4.1.min.js')  //Also tried with Jquery-3.5.1
    .pipe(sourcemaps.init())
    .pipe(concat('build.min.js'))
    .pipe(javascriptObfuscator({
        compact: true
    }))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('dist'));
@drkNsubuga drkNsubuga changed the title V1.1.6 produces a TypeError with jquery TypeError with jquery Jul 21, 2020
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

1 participant