我有一个用 ember 创建的 localhost 网站,它运行良好。
我想使用 Lighthouse 来获取一些关于一段时间内性能的指标。当然,我希望它在 Chrome 中并且是无头的。我使用 NPM 安装了 Lighthouse 并运行以下命令:
lighthouse http://localhost:4200 -chrome-flags='--headless'
在上面运行时,我收到以下错误,导致一个问号作为性能指标:
Chrome didn't collect any screenshots during the page load. Please make sure there is content visible on the page, and then try re-running Lighthouse. (SPEEDINDEX_OF_ZERO)
我尝试使用 http-server 包运行 ember 的 dist 文件夹,但结果没有差异。发生同样的错误。
当我在我们的测试环境中针对 google.com 或网站运行测试时,我得到的是结果而不是错误。当同事在他的本地机器上运行它时,不会发生错误。我们能发现的唯一区别是他运行的是win8.1,而我的机器是win10。
当我在没有无头标记的情况下运行 Chrome 时,我也会得到一个结果,但我需要它无头工作。
我正在使用 Lighthouse、Chrome、Windows10、node 的所有最新版本。也尝试过 Chromium,但没有区别。
希望有人有想法