Error when using Uglify Node API (with OS X Lion)

127 views
Skip to first unread message

JamesV

unread,
Aug 15, 2011, 8:33:21 AM8/15/11
to UglifyJS
I have started to use UglifyJS, and am very impressed with its
capabilities. I am, however, having a problem with the JavaScript API
for Node. In OS X Lion I get the error below.

I used npm to get Uglify - is that an earlier, broken version? I had
trouble following the instructions for installing it from github, and
am not sure if I am using the version from there or from NPM.

Any help with this would be much appreciated.

-----------------------------------------------------------------------------------------------------------

/Users/james/Documents/workspace/mbnodejs/node_modules/uglify-js/lib/
parse-js.js:709
S.token = S.input();
^
TypeError: Property 'input' of object #<Object> is not a function
at next (/Users/james/Documents/workspace/mbnodejs/node_modules/
uglify-js/lib/parse-js.js:709:37)
at Object.parse (/Users/james/Documents/workspace/mbnodejs/
node_modules/uglify-js/lib/parse-js.js:695:19)
at Server.<anonymous> (/Users/james/Documents/workspace/mbnodejs/
app_doc.js:346:20)
at Server.emit (events.js:68:17)
at HTTPParser.onIncoming (http.js:1114:12)
at HTTPParser.onHeadersComplete (http.js:108:31)
at Socket.ondata (http.js:1009:22)
at Socket._onReadable (net_legacy.js:683:27)
at IOWatcher.onReadable [as callback] (net_legacy.js:177:10)

Alexander Gyoshev

unread,
Sep 11, 2011, 3:45:55 PM9/11/11
to ugli...@googlegroups.com
You probably figured it out already, but here it is: this happens if you don't pass valid source to parser.parse (e.g. passing `null`, or a byte array won't work -- you need to pass a string that contains the source).
Reply all
Reply to author
Forward
0 new messages