You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: (0, https_proxy_agent_1.default) is not a function when using jsforce with https-proxy-agent@7+ #1758
After updating my dependencies, my application started throwing the following error when making requests with JSforce:
TypeError: (0, https_proxy_agent_1.default) is not a function. (In '(0, https_proxy_agent_1.default)(httpProxy)', '(0, https_proxy_agent_1.default)' is undefined)
at startFetchRequest (/node_modules/jsforce/lib/request.js:53:55)
at request (/node_modules/jsforce/lib/request.js:206:5)
...
Attempt any operation that requires httpProxy (or leave HTTP_PROXY / HTTPS_PROXY set in the environment).
JSforce crashes with the above error.
Expected Behavior:
JSforce should work with https-proxy-agent@7+ without error, using the new API.
Actual Behavior:
JSforce is calling https_proxy_agent_1.default(httpProxy) which assumes a default-exported function. Since https-proxy-agent@7 now uses a named export (HttpsProxyAgent class), this results in undefined and a runtime TypeError.
Cause:
https-proxy-agent@5 had a CommonJS-compatible default export that was callable.
https-proxy-agent@7 uses ESM-only named exports:
JSforce code in request.js still expects the older default function API.
Workarounds:
Pin https-proxy-agent to 5.0.1 using overrides / resolutions.
Or unset/remove httpProxy if not needed.
Proposed Fix:
Update JSforce’s import and usage to handle the current API:
Activity