Open rainydayDY opened 2 years ago
https://git.n.xiaomi.com/appstore-frontend/appstore-mobile/-/jobs/7951614 isn't working for me, do you have another URL?
I don't think this access link is important. What really matters is the error message that follows. I hope to run lighthouse in cicd, but it doesn't work. I guess it's because there is a problem with starting chrome, because there is no chrome available in cicd? So what should I do?
Yes, you need chrome installed.
@paulirish any idea why the error message here is non-existent? Whatever this error pattern is, it doesn't seem to result in an error message https://github.com/GoogleChrome/chrome-launcher/blob/ff91c18bdf12b142d6f21f8ed5fd81e9835aae82/src/utils.ts#L36
how can I run lighthouse in Docker?I find an answer https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker, Can this be used? I want to use lighthouse in CICD, how should I set it up?
@rainydayDY the callstack indicates chrome-launcher cannot find a chrome installation in the linux OS. you can either have one in a typical location or use the CHROME_PATH
environment variable to point to one. i guess your docker image doesnt have chrome?
it's a bug that we don't provide a proper error message, though !
I added a chrome image to docker, and new problems occurred after running
(node:91) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:42697 [318](https://git.n.xiaomi.com/appstore-frontend/appstore-mobile/-/jobs/7969622#L318) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) [319](https://git.n.xiaomi.com/appstore-frontend/appstore-mobile/-/jobs/7969622#L319)(Use
node --trace-warnings ...to show where the warning was created) [320](https://git.n.xiaomi.com/appstore-frontend/appstore-mobile/-/jobs/7969622#L320)(node:91) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) [321](https://git.n.xiaomi.com/appstore-frontend/appstore-mobile/-/jobs/7969622#L321)(node:91) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
There was no problem with mirroring, it was later solved by adding --no-sandbox
const chrome = await chromeLauncher.launch({ chromeFlags: ['--headless', '--no-sandbox'], });
Thank you so much and good luck~
FAQ
URL
https://git.n.xiaomi.com/appstore-frontend/appstore-mobile/-/jobs/7951614
What happened?
I run it correctly locally, but when I run gitlab ci, I get an error。The error message is as follows:
What did you expect?
run collectly with gitlab ci, I want to run performance when deploy pages
What have you tried?
nothing
How were you running Lighthouse?
CLI
Lighthouse Version
9.6.1
Chrome Version
No response
Node Version
14.17.3
OS
Mac
Relevant log output