Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

update package https-proxy-agent #246

Merged
merged 8 commits into from
Jan 28, 2021
Merged

Conversation

cscharf
Copy link
Contributor

@cscharf cscharf commented Jan 12, 2021

See: bitwarden/cli#181

This resolves the upstream error for the CLI being able to access via proxy with the error, Protocol "https:" not supported.

Current issue is: jasmine tests in the karma runner fail with the npm package update... haven't been able to trace down the reason, but this would need to be resolved/figured out before moving forward with this update 馃檨

@cscharf cscharf requested review from a team and removed request for a team January 12, 2021 18:06
kspearrin
kspearrin previously approved these changes Jan 12, 2021
@cscharf cscharf changed the title update package http-proxy-agent update package https-proxy-agent Jan 12, 2021
@eliykat eliykat marked this pull request as draft January 26, 2021 05:48
@eliykat
Copy link
Member

eliykat commented Jan 26, 2021

The problem seems to be:

  • the karma spec uses the @fluffy-spoon/substitute module to create mock objects
  • in turn, substitute imports node's util module.
  • however, the util module does not consistently get bundled by karma-typescript when running browser tests. This means that require("util") silently fails, and it throws an error the first time substitute tries to call a method from util.

I think it's some kind of race condition, because it behaves really inconsistently - I thought I'd solved it 3 or 4 times today just by changing different things.

By importing util in the spec, it seems to have forced karma-typescript to include it in the bundle. It's not really the right way to fix it though, I'll have a look at karma's docs tomorrow.

@eliykat
Copy link
Member

eliykat commented Jan 27, 2021

Alright, this git history got a little messy 馃槄 Let me know if you want me to tidy it up somehow.

The problem is definitely with resolving and/or bundling the util module. I noticed that in master, the karma-typescript bundler resolves util imports to node_modules/util, but in this branch, it had started resolving to node_modules/karma-typescript/node_modules/util. (I can't see any reason for this sudden change in behaviour or even why it would cause this error - if it is the cause of this error! - so it might be an upstream issue.)

Adding an explicit resolution alias in karma.conf.js so it resolves to the top-level util module has fixed it.

@eliykat eliykat marked this pull request as ready for review January 27, 2021 04:04
@cscharf cscharf removed the hold Do not merge, do not approve yet label Jan 27, 2021
@cscharf cscharf requested review from kspearrin and a team January 27, 2021 14:02
@cscharf cscharf merged commit 06239ae into master Jan 28, 2021
@cscharf cscharf deleted the update-http-proxy-agent-5.0 branch January 28, 2021 01:08
@cscharf
Copy link
Contributor Author

cscharf commented Jan 28, 2021

Gah!!! Build failed, https://github.com/bitwarden/jslib/runs/1781119657?check_suite_focus=true, @eliykat , would you mind please taking a peek?

@eliykat
Copy link
Member

eliykat commented Jan 28, 2021

Note for posterity: I suspect this may have been caused by merge conflicts in package-lock.json, but re-running the tests fixed it, so I'm not doing any further investigation at this stage.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants