Skip to content
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

Runtime error encountered: flags.trim is not a function after update to 2.8.0 to 2.9.1 #4596

Closed
m2kannojiya opened this issue Feb 21, 2018 · 2 comments

Comments

@m2kannojiya
Copy link

m2kannojiya commented Feb 21, 2018

Earlier I was using 2.8.0 and report was running fine but after update I am getting issue as given below.

lighthouse http://localhost:8080 --chrome-flags="--headless" --chrome-flags="--no-sandbox" --output json --output html --output-path ./reports/lighthouse/lighthouse.json

22:20:02 Starting up http-server, serving dist/retail
22:20:02 Available on:
22:20:02 http://127.0.0.1:8080
22:20:02 Hit CTRL-C to stop the server
22:20:03 Runtime error encountered: flags.trim is not a function
22:20:03 TypeError: flags.trim is not a function
22:20:03 at parseChromeFlags
/node_modules/lighthouse/lighthouse-cli/run.js:33:13)
22:20:03 at getDebuggableChrome
/node_modules/lighthouse/lighthouse-cli/run.js:58:18)
22:20:03 at chromeP.then._
/node_modules/lighthouse/lighthouse-cli/run.js:162:7)
22:20:03 at process._tickCallback (internal/process/next_tick.js:103:7)
22:20:03 at Module.runMain (module.js:606:11)
22:20:03 at run (bootstrap_node.js:394:7)
22:20:03 at startup (bootstrap_node.js:149:9)
22:20:03 at bootstrap_node.js:509:3
22:20:03
22:20:03 npm ERR! Linux 3.10.0-693.11.6.el7.x86_64
22:20:03 npm ERR! argv "/data/slave/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_6.10.0/bin/node" "/data/slave/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_6.10.0/lib/node_modules/npm/bin/npm-cli.js" "run" "lighthouse"

@patrickhulce
Copy link
Collaborator

patrickhulce commented Feb 21, 2018

This appears to be a regression caused by #4441, but honestly it is somewhat of an accident that it ever worked at all. --chrome-flags was never intended to be added multiple times, the expected usage for your case is --chrome-flags="--headless --no-sandbox" which still works in 2.9.1

I guess we'll need to decide if we want to officially support this or not.

@paulirish
Copy link
Member

i'd prefer to not support --chrome-flags="--headless" --chrome-flags="--no-sandbox".

(though yargs would make this kinda ez with the .array() method. but still.. would prefer to avoid if we can.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants