lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

stack-pack icuMessagePaths are broken for LH npm installs

Open brendankenny opened this issue 3 years ago • 1 comments

I noticed this in HTTPArchive/WPT LHRs, which have i18n keys like "../../../../home/pmeenan/wptagent/node_modules/lighthouse-stack-packs/packs/ezoic.js | unused-css-rules" in them.

It looks like it's an issue when you install lighthouse as an npm dep (i.e. not a github checkout or bundled), e.g.

mkdir tmp
cd tmp
# broken in lighthouse and lighthouse@next
npm i lighthouse
npx lighthouse https://make.wordpress.org/ --quiet --view

open devtools against the report and look at __LIGHTHOUSE_JSON__.i18n.icuMessagePaths, like

Object.keys(__LIGHTHOUSE_JSON__.i18n.icuMessagePaths).filter(p => p.startsWith('..'))

for me returns 21 paths like "../../../../tmp/node_modules/lighthouse-stack-packs/packs/react.js | unminified-css.

In practice this means you can't swap locales for stack pack strings and they'll always be in en-US.

brendankenny avatar Jul 29 '22 21:07 brendankenny

In practice this means you can't swap locales for stack pack strings and they'll always be in en-US.

Yeah, it's actually worse than this. Looks like paths are broken from the start, so stack pack strings aren't localized for npm installs.

repro: npx lighthouse https://make.wordpress.org/ --quiet --view --locale=es

look at Reducir el tiempo de respuesta inicial del servidor -> stack pack suggestion is still in en-US

brendankenny avatar Aug 08 '22 22:08 brendankenny