Vulcanize errors do not reference source file |
|
Issue description
I made changes to network_summary_item.html and network_summary_item.js and got the following build error with vulcanization enabled. There is no reference to which of my changes might be the problem. I confirmed that the code builds without my changes.
I will now resort to removing my changes one by one, but it would be mice if we could reference the original source lines:
FAILED: gen/chrome/browser/resources/settings/vulcanized.unbuilt.html gen/chrome/browser/resources/settings/crisper.js
python ../../chrome/browser/resources/vulcanize_gn.py --host md-settings --html_in_file settings.html --html_out_file vulcanized.unbuilt.html --js_out_file crisper.js --input gen/chrome/browser/resources/settings/settings_resources.pak --out_folder gen/chrome/browser/resources/settings --depfile gen/chrome/browser/resources/settings/vulcanize.d --insert_in_head \<base\ href=\"chrome://\$i18n{hostname}\"\>
../../third_party/node/linux/node-linux-x64/bin/node ../../third_party/node/node_modules/uglifyjs/bin/uglifyjs /usr/local/google/home/stevenjb/Work/chrome/src/out_daisy/Release/gen/chrome/browser/resources/settings/crisper.js --comments "/Copyright|license|LICENSE|\<\/?if/" --output /usr/local/google/home/stevenjb/Work/chrome/src/out_daisy/Release/gen/chrome/browser/resources/settings/crisper.js failed: Parse error at /usr/local/google/home/stevenjb/Work/chrome/src/out_daisy/Release/gen/chrome/browser/resources/settings/crisper.js:44633,22
Unexpected token punc «(», expected punc «:»
Error
at new JS_Parse_Error (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:196:18)
at js_error (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:204:11)
at croak (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:674:9)
at token_error (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:682:9)
at expect_token (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:695:9)
at expect (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:698:36)
at /usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:1251:13
at /usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:721:24
at expr_atom (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:1181:35)
at maybe_unary (/usr/local/google/home/stevenjb/Work/chrome/src/third_party/node/node_modules/uglifyjs/lib/parse.js:1357:19)
Traceback (most recent call last):
File "../../chrome/browser/resources/vulcanize_gn.py", line 217, in <module>
main(sys.argv[1:])
File "../../chrome/browser/resources/vulcanize_gn.py", line 211, in main
_vulcanize(vulcanize_input_folder, args)
File "../../chrome/browser/resources/vulcanize_gn.py", line 176, in _vulcanize
'--output', js_out_path])
File "../../third_party/node/node.py", line 28, in RunNode
raise
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType
,
Feb 22 2017
BTW, you can open crisper.js from within the out/gen folder and go to line 44633. This will show you the code causing the error, and from there you can deduce the file. Still manual, but you don't have to relplay your changes 1 by one.
,
Feb 22 2017
Well, in this case there weren't that many changes, and it was my classic blunder of using C style function declarations in a Polymer object (which of course clang is fine with because it's valid ES6). It would be -nice- if we could correlate crisper.js lines to source lines somewhere and do a lookup, or maybe at least output a snippet from the crisper.js file, but I understand that falls pretty deep into the "nice to have" category. That said, I doubt I will be the last person to file a bug like this...
,
Feb 22 2017
this is almost certainly a `for ( of )`
,
Feb 22 2017
and i am certainly wrong ^
,
Feb 22 2017
:) You had the right idea though.
,
Feb 23 2017
Agreed that probably more people will hit this, and it is a nice to have. But what would be even nicer is if we did not expect uglifyjs to throw any errors, and it does not limit us from using ES6. I think we should focus more there (upgrading our deps to an ES6 friendly minimizer/uglifier), than polishing the existing non ES6 friendly tools.
,
Feb 23 2017
sgtm, feel free to dupe this to an issue tracking ES6 support in vulcanize :) |
|
►
Sign in to add a comment |
|
Comment 1 by dpa...@chromium.org
, Feb 22 2017