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

[Fixed] Errors with STDIN #85

Closed
arnaudlimbourg opened this issue Dec 31, 2012 · 5 comments
Closed

[Fixed] Errors with STDIN #85

arnaudlimbourg opened this issue Dec 31, 2012 · 5 comments

Comments

@arnaudlimbourg
Copy link

Hello,

I tried to report that problem earlier but as the code example was not correct due to copy paste errors I have redone the whole process to reproduce the error.

$ mkvirtualenv uglifybug
$ npm install uglify-js
$ npm list
  /Users/arnaud/.virtualenvs/uglifybug/lib
└─┬ uglify-js@2.2.2
      ├─┬ optimist@0.3.5
     │   └── wordwrap@0.0.2
     └─┬ source-map@0.1.8
           └── amdefine@0.0.4
$ wget http://code.jquery.com/jquery-1.8.3.js
$ cat jquery-1.8.3.js| /usr/bin/env uglifyjs                                                                                                                (env: uglifybug) 
WARN: ERROR: Unexpected token eof «undefined», expected punc «)» [-:2421,35]

/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:199
    throw new JS_Parse_Error(message, line, col, pos);
          ^
Error
    at new JS_Parse_Error (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:185:18)
    at js_error (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:199:11)
    at croak (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:630:9)
    at token_error (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:638:9)
    at expect_token (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:651:9)
    at expect (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:654:36)
    at parenthesised (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:670:9)
    at if_ (/Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:918:20)
    at /Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:758:24
    at /Users/arnaud/.virtualenvs/uglifybug/lib/node_modules/uglify-js/lib/parse.js:677:24

Running the following command does output any error

$ /usr/bin/env uglifyjs jquery-1.8.3.js

This will hopefully help and make the issue clearer.

I may be doing something wrong but I get this result consistently.

@mishoo
Copy link
Owner

mishoo commented Jan 2, 2013

This has been reported before. I can't reproduce it on Linux though; the previous report also looked like it was on a Mac — perhaps there's a bug in /usr/bin/env on OSX, it seems to mess with stdin somehow. UglifyJS reads the standard input from /dev/stdin.

Sorry but I don't have a Mac, therefore I've no idea how to investigate.

@arnaudlimbourg
Copy link
Author

@mishoo it is indeed on a mac, I somehow forgot to specify that. I will try to have a deeper look.

@wyuenho
Copy link

wyuenho commented Feb 20, 2013

I just ran into this problem too. I'm also on a Mac.

@qur2
Copy link

qur2 commented Mar 21, 2013

I also struggle with this problem on OSX, do you when a new version containing commit f83aca6 will be released to npm?
Thanks!

@arnaudlimbourg
Copy link
Author

This error does not appear anymore.

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

4 participants