Skip to content

chore(deps): update proxy-agent to newer version#1196

Open
wing328 wants to merge 4 commits into
masterfrom
update-proxy-agent
Open

chore(deps): update proxy-agent to newer version#1196
wing328 wants to merge 4 commits into
masterfrom
update-proxy-agent

Conversation

@wing328
Copy link
Copy Markdown
Member

@wing328 wing328 commented May 16, 2026

Summary by cubic

Update proxy-agent to ^8.0.1 and make the import runtime-safe across CJS/ESM. We now lazily create ProxyAgent only when proxy env vars are set, and set httpAgent/httpsAgent accordingly.

  • Dependencies
    • Bumped proxy-agent to ^8.0.1.
    • Updated app.module.ts to use require('proxy-agent').default ?? require('proxy-agent') and instantiate per protocol under env checks.
    • Regenerated yarn.lock to capture the v8 stack: http-proxy-agent@9, https-proxy-agent@9, pac-proxy-agent@9, pac-resolver@9, socks-proxy-agent@10, agent-base@9, get-uri@8, data-uri-to-buffer@8, degenerator@7, quickjs-wasi@^2.2.0, proxy-from-env@^2.

Written for commit 21ee14e. Summary will update on new commits. Review in cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/generator-cli/src/app/app.module.ts">

<violation number="1" location="apps/generator-cli/src/app/app.module.ts:22">
P1: proxy-agent v8 should be imported via its named export; this require fallback can break when proxy env vars are set.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic

httpModuleConfig.proxy = false;
httpModuleConfig.httpAgent = proxyAgent;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ProxyAgent = require('proxy-agent').default ?? require('proxy-agent');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: proxy-agent v8 should be imported via its named export; this require fallback can break when proxy env vars are set.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/generator-cli/src/app/app.module.ts, line 22:

<comment>proxy-agent v8 should be imported via its named export; this require fallback can break when proxy env vars are set.</comment>

<file context>
@@ -17,16 +16,18 @@ const hasHttpProxyEnvs = process.env.HTTP_PROXY || process.env.http_proxy;
   httpModuleConfig.proxy = false;
-  httpModuleConfig.httpAgent = proxyAgent;
+  // eslint-disable-next-line @typescript-eslint/no-var-requires
+  const ProxyAgent = require('proxy-agent').default ?? require('proxy-agent');
+  httpModuleConfig.httpAgent = new ProxyAgent();
 }
</file context>

Tip: Review your code locally with the cubic CLI to iterate faster.

@wing328
Copy link
Copy Markdown
Member Author

wing328 commented May 16, 2026

cc @jontze who added proxy-agent to the code.

@jontze when you've time, can you please review this change? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant