-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
misc: exit collect-strings script with error code on failure #12971
Conversation
Looks like something broke in treemap. Not sure if the failing pptr is the same underlying issue, but looking at the vercel builds, it looks like there's been a bundling problem since #12892 (see deployed treemap from that PR for what looks like the first occurrence of the #12953 also just touched the treemap UIString bundling, relevant to the changes here, and I (shameface) just relied on the pptr test and didn't check the deployed version for it either. |
@@ -18,7 +18,7 @@ function buildStrings() { | |||
const locales = require('../lighthouse-core/lib/i18n/locales.js'); | |||
// TODO(esmodules): use dynamic import when build/ is esm. | |||
const utilCode = fs.readFileSync(LH_ROOT + '/lighthouse-treemap/app/src/util.js', 'utf-8'); | |||
const {UIStrings} = eval(utilCode.replace('export ', '') + '\nmodule.exports = TreemapUtil;'); | |||
const {UIStrings} = eval(utilCode.replace(/export /g, '') + '\nmodule.exports = TreemapUtil;'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, I guess this technically works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a different solution you had in mind?
Summary
When the collect strings script was converted to be async, the script didn't also handle UnhandledPromiseRejections for an appropriate exit code (see latest master run for example). Later there was a change to move UIStrings in a way that didn't export them but we didn't catch it.
This fixes both of those two issues.
Related Issues/PRs
fixes collect strings regression from #12741
fixes string regression from #12892