Skip to content

Conversation

@patrickhulce
Copy link
Collaborator

@patrickhulce patrickhulce commented Aug 23, 2021

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

@patrickhulce patrickhulce requested a review from a team as a code owner August 23, 2021 17:39
@patrickhulce patrickhulce requested review from connorjclark and removed request for a team August 23, 2021 17:39
@google-cla google-cla bot added the cla: yes label Aug 23, 2021
@brendankenny
Copy link
Contributor

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 logger is not defined error).

#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.

// 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;');
Copy link
Collaborator

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.

Copy link
Collaborator Author

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?

@connorjclark connorjclark merged commit be053db into master Aug 23, 2021
@connorjclark connorjclark deleted the collect_strings_bug branch August 23, 2021 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants