foo-software/lighthouse-check

ERROR_NO_RESULTS when domain name includes double dash

Closed this issue · 10 comments

Hello!

I'm getting the ERROR_NO_RESULTS error when the URL I'm checking includes -- sequence. Here's an example:

$ lighthouse-check --verbose --isOrb --urls https://pr36-cu--0y5ikr.herokuapp.com

❌  Something went wrong while attempting to enqueue URLs for Lighthouse. See the error below.

 LighthouseCheckError: Something went wrong - no results.
    at /usr/lib/node_modules/@foo-software/lighthouse-check/dist/lighthouseCheck.js:181:16 {
  code: 'ERROR_NO_RESULTS',
  data: undefined
}

As an ugly workaround, I'm using shell magic to escape -- in URLs with %2D- which solves the issue for me but I believe there is a better solution:

$ lighthouse-check --verbose --isOrb \
         --urls `echo https://pr36-cu--0y5ikr.herokuapp.com | sed 's/--/%2D-/g'`


+--------------------------------------------------------------------------+
|                             Lighthouse Audit                             |
+--------------------------------------------------------------------------+

URL: https://pr36-cu%2D-0y5ikr.herokuapp.com
…

Thanks for reporting this @michaelkl. I'll look into it shortly.

Thanks again for reporting this @michaelkl. URLs with -- character sequence were failing because of an issue in the home baked CLI flag parsing solution. I was able to fix it in #28. I also bumped the version in lighthouse-check-action GitHub Action. Feel free to confirm, but closing for now.

@adamhenson I'm getting an error TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type boolean (true) on my CircleCI since today.
That's because of --configFile parameter which defaults to an empty string in the orb: if I remove it when running manually - it works.

I'm using the orb: https://circleci.com/orbs/registry/orb/foo-software/lighthouse-check#orb-source

Not sure if it is related to this fix but seems it's not just a coincidence. :-)

Hi @michaelkl - thanks for sharing. Could you share your config code?

No worries - thanks @michaelkl. I'm also reproducing this. For now, reverting the Docker image. Will provide an update shortly.

Thank you @adam for great work! Glad to help!

Yep, that was a good find @michaelkl - you were right. The empty flags that were expected to be non-booleans were previously ignored, but since I added meow they were converted to boolean types. This behavior is ideal, but we just weren't correctly handling it. Fixed in #29

If you have a chance to test it out in your CircleCI workflow, please do let me know the result. Closing again, but happy to re-open if anything is unresolved.

Both fixes work like a charm! 🚀 Thank you @adamhenson 👍

Excellent, thanks for your help on this @michaelkl.