Lighthouse parameter passed as string instead of boolean

Open
#81 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
performance

Research direction

Reproduce the issue with the provided Docker command and inspect the verbose Lighthouse configuration, especially screenEmulation.mobile. Trace where the command-line value is converted into the Lighthouse settings object; done means the desktop configuration passes a boolean value and Lighthouse runs without the type-mismatch error.

Written by the indexing model from the issue text.

Description

awaiting response prio:medium

I want to run lighthouse in desktop settings, but based on issue #68, looks like we can't use official documentation guide to run lighthouse in desktop settings. I tried in 16.10.3 but it produce same result as #68.

I tried to dig lighthouse configuration and find that we need to change formFactor and some other settings to run lighthouse in desktop settings. But when I tried to run this command:

docker run sitespeedio/sitespeed.io:16.10.3-plus1 -n 1 --mobile false --lighthouse.extends 'lighthouse:default' 
--lighthouse.settings.formFactor desktop --lighthouse.settings.screenEmulation.mobile false 
'https://www.google.com/' --plugins.add /lighthouse

I got following error:

ERROR: Lighthouse could not test https://www.google.com/ please create an upstream issue: https://github.com/GoogleChrome/lighthouse/issues/new?template=Bug_report.md 
Error: Screen emulation mobile setting (false) does not match formFactor setting (desktop). 
See https://github.com/GoogleChrome/lighthouse/blob/master/docs/emulation.md

I tried to pass verbose flag and this is the output:

...
"lighthouse": {
      "extends": "lighthouse:default",
      "settings": {
        "formFactor": "desktop",
        "screenEmulation": {
          "mobile": "false"
        }
     }
},
...

The flag is passed as string instead of boolean.

I'm not sure if this is the root cause of the error because mobile parameter is passed as string and it's works. Maybe this is happened because in lighthouse, there's strict type validation

Dominant language
JavaScript
Stars
31
Forks
21
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sitespeedio/plugin-lighthouse

All issues in sitespeedio/plugin-lighthouse

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.