paulirish / pwmetrics

Progressive web metrics at your fingertipz
Apache License 2.0
1.25k stars 74 forks source link

flags.trim() error #162

Closed jooj123 closed 6 years ago

jooj123 commented 6 years ago

Config / CLI options

module.exports = {
  url: 'http://localhost:3000/blahblah',
  flags: {
    runs: '1', 
    submit: false, 
    upload: false, 
    view: false, 
    expectations: true,
    chromeFlags: [
      '--headless',
    ],
  },
  expectations: {
    ttfcp: {
      warn: '>=7189',
      error: '>=9000',
    },
    ttfmp: {
      warn: '>=8387',
      error: '>=10000',
    },
    psi: {
      warn: '>=30842',
      error: '>=35000',
    },
    fv: {
      warn: '>=7190',
      error: '>=8000',
    },
    vc: {
      warn: '>=30912',
      error: '>=35000',
    },
    vc85: {
      warn: '>=28759',
      error: '>=30000',
    },
  },
};

Steps to reproduce.

Run: pwmetrics --config=test/performance/pwmetrics-config.js as npm command

Stack trace

/Users/martin.jujou/Documents/projects/fe-server-search-results/node_modules/lighthouse/lighthouse-cli/run.js:33
      flags.trim(), {configuration: {'camel-case-expansion': false, 'boolean-negation': false}});
            ^

TypeError: flags.trim is not a function
    at parseChromeFlags (/Users/martin.jujou/Documents/projects/fe-server-search-results/node_modules/lighthouse/lighthouse-cli/run.js:33:13)
    at new PWMetrics (/Users/martin.jujou/Documents/projects/fe-server-search-results/node_modules/pwmetrics/lib/index.js:57:34)
    at Object.<anonymous> (/Users/martin.jujou/Documents/projects/fe-server-search-results/node_modules/pwmetrics/bin/cli.js:99:19)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Screenshot

NA

Environment

  1. pwmetrics version: 3.1.6
  2. Chrome version: 64
  3. OS version: Mac El Capitan

Note: if i go back to version 3.1.2 everything works.

denar90 commented 6 years ago

I tried with http://example.com url and it works fine. @jooj123 can you plz try another url? maybe problem that page can't be reached, I dunno right now...

jooj123 commented 6 years ago

Not sure why but I can no longer reproduce .. Closing for now

mbejda commented 5 years ago

It may be related to this Lighthouse issue. Runtime error encountered: flags.trim is not a function after update to 2.8.0 to 2.9.1 https://github.com/GoogleChrome/lighthouse/issues/4596