Lighthouse: Getting Runtime error encountered: this._select is not a function TypeError: this._select is not a function.Cannot view html report while running from command line

Created on 18 Oct 2019  Â·  16Comments  Â·  Source: GoogleChrome/lighthouse

Command used- lighthouse https://github.com/intuit/karate --view
npm version-6.4.1
node version-v10.15.3
OS-windows 10 Pro

ChromeLauncher Killing Chrome instance 17864 +27ms
Runtime error encountered: this._select is not a function
TypeError: this._select is not a function
at PluralRules.select (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\node_modules\intl-pluralrules\factory.js:143:21)
at PluralFormat.getOption (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\node_modules\intl-messageformat\dist\compiler.js:161:38)
at formatPatterns (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\node_modules\intl-messageformat\dist\core.js:69:43)
at IntlMessageFormat.format (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\node_modules\intl-messageformat\dist\core.js:139:24)
at _formatIcuMessage (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\lib\i18n\i18n.js:293:37)
at _resolveIcuMessageInstanceId (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\lib\i18n\i18n.js:424:29)
at replaceInObject (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\lib\i18n\i18n.js:452:55)
at replaceInObject (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\lib\i18n\i18n.js:465:9)
at replaceInObject (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\lib\i18n\i18n.js:465:9)
at Object.replaceIcuMessageInstanceIds (C:\Users\CYRIL\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\lib\i18n\i18n.js:472:3)

pending-close

Most helpful comment

Seeing this error as well running npx -p lighthouse lighthouse https://www.google.com on Node v10.16.3 on macOS 10.14.6

  ChromeLauncher Killing Chrome instance 613 +17ms
Runtime error encountered: this._select is not a function
TypeError: this._select is not a function
    at PluralRules.select (/[...]/.npm/_npx/604/lib/node_modules/lighthouse/node_modules/intl-plu...

All 16 comments

Seeing this error as well running npx -p lighthouse lighthouse https://www.google.com on Node v10.16.3 on macOS 10.14.6

  ChromeLauncher Killing Chrome instance 613 +17ms
Runtime error encountered: this._select is not a function
TypeError: this._select is not a function
    at PluralRules.select (/[...]/.npm/_npx/604/lib/node_modules/lighthouse/node_modules/intl-plu...

Just came to report the same issue
Node v10.15.0
npm 6.4.1
centos-release-7-6

Same issue right here with the docker container of https://github.com/emazzotta/lighthouse-badges.

To reproduce run:

docker run --rm \
    -v $PWD/test_results:/home/chrome/reports \
    emazzotta/lighthouse-badges:failing \
    /bin/sh -c "lighthouse-badges -rsu https://google.com"

Result:

  â—ž Running Lighthouse, please wait...
Error: Command failed: /home/lighthouse/node_modules/.bin/lighthouse --chrome-flags='--headless --no-sandbox --no-default-browser-check --no-first-run --disable-default-apps' --output=json --output-path=stdout --quiet https://google.com
Runtime error encountered: this._select is not a function
TypeError: this._select is not a function
    at PluralRules.select (/home/lighthouse/node_modules/intl-pluralrules/factory.js:143:21)
    at PluralFormat.getOption (/home/lighthouse/node_modules/intl-messageformat/dist/compiler.js:161:38)
    at formatPatterns (/home/lighthouse/node_modules/intl-messageformat/dist/core.js:69:43)
    at IntlMessageFormat.format (/home/lighthouse/node_modules/intl-messageformat/dist/core.js:139:24)
    at _formatIcuMessage (/home/lighthouse/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:293:37)
    at _resolveIcuMessageInstanceId (/home/lighthouse/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:424:29)
    at replaceInObject (/home/lighthouse/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:452:55)
    at replaceInObject (/home/lighthouse/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:465:9)
    at replaceInObject (/home/lighthouse/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:465:9)
    at Object.replaceIcuMessageInstanceIds (/home/lighthouse/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:472:3)

The container is running:

  • Node v11.15.0
  • npm 6.7.0
  • Lighthouse 5.6.0

on Alpine Linux

Edit

The issue is fixed for me once I upgraded the docker container's source image from:
node:11-alpine to node:12.12-alpine

Same issue here:

$ lighthouse https://google.com --chrome-flags="--headless --no-sandbox"
...
ChromeLauncher Killing Chrome instance 30043 +21ms
Runtime error encountered: this._select is not a function
TypeError: this._select is not a function
    at PluralRules.select (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/node_modules/intl-pluralrules/factory.js:143:21)
    at PluralFormat.getOption (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/node_modules/intl-messageformat/dist/compiler.js:161:38)
    at formatPatterns (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/node_modules/intl-messageformat/dist/core.js:69:43)
    at IntlMessageFormat.format (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/node_modules/intl-messageformat/dist/core.js:139:24)
    at _formatIcuMessage (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:293:37)
    at _resolveIcuMessageInstanceId (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:424:29)
    at replaceInObject (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:452:55)
    at replaceInObject (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:465:9)
    at replaceInObject (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:465:9)
    at Object.replaceIcuMessageInstanceIds (/Users/jelmaa/.nvm/versions/node/v10.16.3/lib/node_modules/lighthouse/lighthouse-core/lib/i18n/i18n.js:472:3)

Version info:

  • node v10.16.3
  • npm 6.9.0
  • lighthouse 5.6.0

On a macOS Mojave, MacBook Pro (Retina, 15-inch, Mid 2015)

Thanks folks! This is a bug in one of our dependency packages, if you have the ability to install intl-pluralrules 1.0.3 (through yarn or package-lock.json) you should be good to go.

If you are using yarn you can add a resolutions key to your package.json and that should fixit 😄, something like:

"resolutions": {
    "lighthouse/intl-pluralrules": "1.0.3"
  }

That does not work for us.
Tried locally, installing
intl-pluralrules 1.0.3
Lighthouse version 5.6.0, 5.5.0 and 5.4.0
and same error every-time i ran:

lighthouse http://google.com/

@hajtomoto Depending on the order you installed the packages it might still be around. Do you have files at ./node_modules/lighthouse/node_modules/intl-pluralrules? If you rm -rf ./node_modules/lighthouse/node_modules/intl-pluralrules and you've installed 1.0.3 at ./node_modules/intl-pluralrules it should start working again.

Some details in https://github.com/eemeli/intl-pluralrules/issues/12#issuecomment-543836285 for what's going on. A downgrade should definitely fix that, but hopefully there will also be a quick fix upstream.

Should now be fixed upstream. Updating to [email protected] will bring in the patched [email protected]. See the above-linked comment for more details.

Is there any plan to from lighthouse upgrade version of intl-pluralrules to 1.1.1?

@irfan-maulana-tkp 1.1.1 satisfies our version range already, a reinstall should be enough for everyone affected during that couple hour window of the bug in 1.1.0.

Marking this as closed since the dependency has been fixed. thanks @eemeli for the quick action here!

How can this issue fixed for npm version-6.4.1
node version-v10.15.3
OS-windows 10 Pro.
The solution is not clear

@cyrilgeorge153 install [email protected]. either by reinstalling your existing lighthouse installation or the yarn resolutions solution mentioned above

It worked .thanks

Was this page helpful?
0 / 5 - 0 ratings