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

Uglify version 1.0.17 #3693

Closed
Bildelsbasen opened this issue May 14, 2018 · 9 comments · May be fixed by Matthelonianxl/lisk-explorer#1
Closed

Uglify version 1.0.17 #3693

Bildelsbasen opened this issue May 14, 2018 · 9 comments · May be fixed by Matthelonianxl/lisk-explorer#1

Comments

@Bildelsbasen
Copy link

Im having trouble using uglify on version 1.0.17.
Getting following error:
JS_Parse_Error { message: 'Unexpected token: punc ())'

stack: 'Error\n at new JS_Parse_Error (/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:196:18)

Best regards
Andreas

@mistic100
Copy link

mistic100 commented May 14, 2018

Somehow the problem seems to be with the TS compilation of ui-router/core

This line https://github.com/ui-router/core/blob/master/src/common/common.ts#L512 is compiled to

         result.push(
            args.map(function(array) {
              return array[i];
            }), // <= extra comma
          );

@ohadcn
Copy link

ohadcn commented May 14, 2018

this breaks my entire build
I've locked my system to 1.0.15 for now

@bobbyziom
Copy link

@mistic100 exactly the same for me with.

To run this version i needed to exclude it from grunt-contrib-concat, and extend the import manually afterwards.

Need to lock my dependencies!

@westy92
Copy link

westy92 commented May 14, 2018

@mistic100 great find! Could this potentially be a TypeScript bug? According to the tsconfig.json, the project is targeting ES5: https://github.com/ui-router/core/blob/master/tsconfig.json#L7.

According to MDN, "ECMAScript 2017 allows trailing commas in function parameter lists."
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas#Trailing_commas_in_functions

@westy92
Copy link

westy92 commented May 14, 2018

I copied the export function arrayTuples(...args: any[]): any[] { function to its own file and also copied the tsconfig.json. The resulting transpiled js did not have the trailing comma:

            default:
                result.push(args.map(function (array) { return array[i]; }));
                break;

Something else must be adding it?

@paulodrade
Copy link

Any update on this bug?

This is breaking my build. I need to go back to v1.0.15 (since v1.0.16 is not available to download).

Thanks

@mistic100
Copy link

mistic100 commented May 16, 2018

It was probably fixed by ui-router/core@578dc09 and 5fb93d0

now we need a release :-)

@r3plica
Copy link

r3plica commented May 17, 2018

Can confirm that I am getting this too. Took me ages to find out the cause.....

@christopherthielen
Copy link
Contributor

christopherthielen commented May 19, 2018

This was a puzzler because the published code on NPM doesn't have any trailing commas. Then I remembered that I added a git precommit hook which runs prettier on all staged files for commit. Finally I remembered that the uirouter bower publish script commits the bundled files to git, and prettier was being run on them.

This issue only affects bower users. (please stop using bower 😉)

I will fix this issue and publish a new release ASAP.

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

Successfully merging a pull request may close this issue.

8 participants