Skip to content

Error after Obfuscation: Uncaught SyntaxError: Unexpected string #486

Closed

Description

@rricamar

Hi,
After a production build with Angular 8.3, if I obfuscate my main script, I get the next error:

Chrome:

Uncaught SyntaxError: Unexpected string :8101/main-es2015.f70397ecef4dd1524efd.js:1

The error message in Firefox is:

SyntaxError: missing formal parameter

Your Environment

  • Obfuscator version used: 0.21.0
  • Node version used: 12.14.1

Also happening with Node 10.16.3 and 0.18.0

Ty for any help 🙏

Activity

  1. rricamar commented on Jan 8, 2020

    @rricamar
    Author

    I can provide the original and the obfuscated script, but it is generated from the Angular Cli (20k lines more or less) ... 😱

  2. sanex3339 commented on Jan 8, 2020

    @sanex3339
    Member

    Can you provide it?

    This error happens when a function has raw value instead of parameter identifier:

    function foo ('rawStringValue') {}
    
  3. rricamar commented on Jan 8, 2020

    @rricamar
    Author

    Hi @sanex3339 , ty a lot for your quick response!
    As far as I know, we don't use that type of statements. Here are the files:

    main-js-obfuscated.zip

    The .zip contains the original file from the Angular CLI process and the obfuscated one.

    Ty again 😀

  4. sanex3339 commented on Jan 8, 2020

    @sanex3339
    Member

    Code to reproduce

    class Foo {
        'test'() {}
    }
    

    With stringArray option it becomes

    class _0x1aa8c8 {
        _0x2942('0x0')() {
        }
    }
    
  5. sanex3339 commented on Jan 9, 2020

    @sanex3339
    Member

    Will fixed in #489

    Expect release tomorrow

  6. rricamar commented on Jan 9, 2020

    @rricamar
    Author

    @sanex3339 so quick, ty a lot 🙏

    I will try new release and let you know if is working

  7. sanex3339 commented on Jan 9, 2020

    @sanex3339
    Member

    Released as 0.22.0

  8. re-jim commented on Jan 10, 2020

    @re-jim

    This newest version 0.22.0 broke stuff for me, causing a

    TypeError: Assignment to constant variable. error, that doesn't happen before obfuscation, only after.

    I don't have enough details at the moment to provide a full reproducible example, however. Just a heads up.

  9. sanex3339 commented on Jan 10, 2020

    @sanex3339
    Member

    Can you send your obfuscated code and options?
    This bug is critical, so i should fix it as soon as possible.

  10. sanex3339 commented on Jan 10, 2020

    @sanex3339
    Member

    Reproduced it, error when controlFlowFlattening option is enabled with code:

    const test = 1;
    (function () {
        console.log(1);
        console.log(2);
        console.log(3);
        console.log(4);
        console.log(5);
    })();
    

    WIll fix it soon

  11. sanex3339 commented on Jan 10, 2020

    @sanex3339
    Member

    Fixed in #491

  12. sanex3339 commented on Jan 10, 2020

    @sanex3339
    Member

    Released as 0.22.1, please try it

  13. sanex3339 commented on Jan 12, 2020

    @sanex3339
    Member

    Closed. Reopen new issue if problem still exist

  14. rricamar commented on Jan 14, 2020

    @rricamar
    Author

    Hi @sanex3339 , I've tried 0.22.1 and is working perfect for me 👍

    Ty for your quick response and fix!

  15. sanex3339 commented on Jan 14, 2020

    @sanex3339
    Member

    Nice!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions