What steps will reproduce the problem?
1. Cause a JS syntax error, such as the one at https://chromium-review.googlesource.com/c/chromium/src/+/1142835
2. Try to build chromium with optimize_webui=true
What is the expected result?
Either Chromium should build or there should be a helpful build error
What happens instead of that?
A super vague compile error:
[1] FAILED: gen/chrome/browser/resources/md_extensions/vulcanized.html gen/chrome/browser/resources/md_extensions/crisper.js
python ../../chrome/browser/resources/optimize_webui.py --host extensions --input gen/chrome/browser/resources/md_extensions/extensions_resources.unpak --out_folder gen/chrome/browser/resources/md_extensions --depfile gen/chrome/browser/resources/md_extensions/build.d --html_in_files extensions.html --html_out_files vulcanized.html --js_out_files crisper.js --insert_in_head \<base\ href=\"chrome://extensions\"\>
Traceback (most recent call last):
File "../../chrome/browser/resources/optimize_webui.py", line 252, in <module>
main(sys.argv[1:])
File "../../chrome/browser/resources/optimize_webui.py", line 246, in main
'\n'.join(manifest['_missing']))
Exception: polymer-bundler could not find files for the following URLs:
chrome://extensions/detail_view.js
ninja: build stopped: subcommand failed.
It seems that the Polymer tools are performing some html/js parsing as part of the webui optimization (e.g., bundling all html/js files). However, if there's an error, the bundling fails, and the error is somehow swallowed by the tools. This results in the maddeningly unhelpful error above.
Given this is only an issue when there's an error in the code, and only if optimize_webui=true, this isn't super high priority to fix. But it would be nice, if we could.