heremaps/harp.gl

Upgrade agent-base package to latest v6.0.2 to fix http proxy issue [ERR_INVALID_PROTOCOL]

drametoid opened this issue · 5 comments

Describe the bug
When trying to do yarn install behind a http proxy, installation fails giving [ERR_INVALID_PROTOCOL]. First at installation of geckodriver package but workaround for that is to set correct proxies in env variable proxy and https-proxy for yarn and npm and to unset env variables http_proxy https_proxy (for capital case too).
However, even after that, I'm getting an error with installation of puppeeteer.
Investigated further and it seems that it has to do with an issue in the agent-base version used in harp.gl. Latest for the package is v6.0.2 whereas harp uses 6.0.1.

This exact issue has been fixed in their latest version. See PR 47.

I can't seem to update it manually due to upstream dependency conflicts.

To Reproduce
Steps to reproduce the behavior:

  1. Set yarn and npm proxy env vars proxy = http://... and https-proxy = http://...
  2. Try yarn install behind these proxies.
  3. Main issue is with accessing https URLs with http proxies.
    NOTE: I have tried this inside docker environment.

Expected behavior
Successful installation of harp.gl package using yarn install command.

Screenshots
See error logs here

Desktop (please complete the following information):

  • OS: Ubuntu 18.04 inside Docker
  • Version:
    a) npm v7.14.0
    b) node v16.2.0

EDIT:
For reference
Agent-base PR
Puppeteer PR

@drametoid , do you mean that you already tried this: c3c6969 ?

If not, does it work?

Hi @nzjony , thanks for the quick response. I tried the fix you've added but on primary analysis it doesn't seem to work - I'm still getting the error when it tries to install the puppeteer package (see previously mentioned error logs). When I set the PUPPETEER_SKIP_CHROMIUM_DOWNLOAD env variable as mentioned in the error, it is able to compile successfully.

Is there any chance you can try this on your machine? I'm using CNTLM for proxy authentication which listens on port 3128 but insecure (http).

Could you also look at this PR for puppeteer, might help. @nzjony

Edit: I checked the yarn.lock file wherein puppeteer is using https-proxy-agent ^4.0.0. Bumping this up to https-proxy-agent 5.0.0 additionally seems to make it work. yarn install compiled successfully after that.

@drametoid , very cool. Can you please create a PR with the fix? Glad you got it working

@nzjony - Added #2212
Thanks for pointing in the right direction. Cheers! 🍻