-
Notifications
You must be signed in to change notification settings - Fork 154
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
Screenshots in "Why use pump?" don't match actual output #264
Comments
I broke it in 2.0.0 by mistake when I refactored away from using the
gulp-utils. I'll fix tonight to get something similar to the old output.
…On Feb 2, 2017 1:39 PM, "Tony Trinh" ***@***.***> wrote:
The screenshot in "Why use pump?"
<https://github.com/terinjokes/gulp-uglify/blob/ccdc482/docs/why-use-pump/README.md>
shows neat output (no typical noisy stack traces) that indicate the error
message, file, and line number:
[image: pump error]
<https://github.com/terinjokes/gulp-uglify/raw/ccdc482a2f9754005b9f1a0d229fa46de8ecceff/docs/why-use-pump/pump-error.png>
...but in reality, it actually like the following.
Without pump:
/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/lib/create-error.js:6
var perr = new GulpUglifyError(msg, cause);
^
GulpUglifyError: unable to minify JavaScript
at createError (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/lib/create-error.js:6:14)
at wrapper (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/lodash/_createHybrid.js:87:15)
at trycatch (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/minifier.js:26:12)
at DestroyableTransform.minify [as _transform] (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/minifier.js:76:19)
at DestroyableTransform.Transform._read (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_transform.js:159:10)
at DestroyableTransform.Transform._write (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_transform.js:147:83)
at doWrite (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_writable.js:347:64)
at writeOrBuffer (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_writable.js:336:5)
at DestroyableTransform.Writable.write (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_writable.js:274:11)
at DestroyableTransform.ondata (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_readable.js:546:20)
With pump:
GulpUglifyError: unable to minify JavaScript
Caused by: SyntaxError: Unexpected token: name (Foo) (line: 1, col: 6, pos: 6)
Error
at new JS_Parse_Error (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1547:18)
at js_error (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1555:11)
at croak (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2094:9)
at token_error (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2102:9)
at unexpected (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2108:9)
at semicolon (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2128:56)
at simple_statement (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2319:73)
at eval (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2188:19)
at eval (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2141:24)
at eval (eval at <anonymous> (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2909:23)
Line number is given but no source filename, which defeats the utility of
the line number. Has the code changed since you made those screenshots? Was
that intentionally removed? (And if so, why?) Or is it a pump-config issue?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#264>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQsZXsiNa7mzi3Z_BVgc6ZR_-2gP9eTks5rYkzMgaJpZM4L1qxJ>
.
|
@tony19 To clear up some confusion: the line and column information you had in your error message is embedded within UglifyJS's error string. UglifyJS doesn't really know about more than one file at a time, thus why it doesn't include the filename in the error. I failed to correct the error string (to add our own file and line information) when we moved to a new error wrapper in v2.0.0. This has now been corrected in v2.1.1. The screenshots still don't exactly match, but the same information is now contained. |
The screenshot in "Why use pump?" shows neat output (no typical noisy stack traces) that indicate the error message, file, and line number:
...but it actually looks like the following.
Without pump:
/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/lib/create-error.js:6 var perr = new GulpUglifyError(msg, cause); ^ GulpUglifyError: unable to minify JavaScript at createError (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/lib/create-error.js:6:14) at wrapper (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/lodash/_createHybrid.js:87:15) at trycatch (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/minifier.js:26:12) at DestroyableTransform.minify [as _transform] (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/gulp-uglify/minifier.js:76:19) at DestroyableTransform.Transform._read (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_transform.js:159:10) at DestroyableTransform.Transform._write (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_transform.js:147:83) at doWrite (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_writable.js:347:64) at writeOrBuffer (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_writable.js:336:5) at DestroyableTransform.Writable.write (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_writable.js:274:11) at DestroyableTransform.ondata (/Users/tony/src/polymer/polymer-typescript-starter-kit/node_modules/readable-stream/lib/_stream_readable.js:546:20)
With pump:
Line number is given but no source filename, which defeats the utility of the line number. Has the code changed since you made those screenshots? Was that intentionally removed? (And if so, why?) Or is it a pump-config issue?
Note the source that's piped through uglify is ES6 (to cause an error):
The gulp script for the task:
Environment
The text was updated successfully, but these errors were encountered: