Skip to content

Comments

[TypeError]: Fix when constructor is calling new instances#795

Closed
admirsaheta wants to merge 3 commits intosnowflakedb:masterfrom
admirsaheta:master
Closed

[TypeError]: Fix when constructor is calling new instances#795
admirsaheta wants to merge 3 commits intosnowflakedb:masterfrom
admirsaheta:master

Conversation

@admirsaheta
Copy link

Description

Fixes
Unexpected error from calling callback function TypeError: Cannot call a class constructor without |new|\n at Agent (node:http:361:14)\n at HttpsOcspAgent

Unexpected error from calling callback function TypeError: this.constructExponentialBackoffStrategy is not a function. (In 'this.constructExponentialBackoffStrategy()', 'this.constructExponentialBackoffStrategy' is undefined)\n at prepareRequestOptions

Checklist

  • Format code according to the existing code style (run npm run lint:check -- CHANGED_FILES and fix problems in changed code)
  • Create tests which fail without the change (if possible)
  • Make all tests (unit and integration) pass (npm run test:unit and npm run test:integration)
  • Extend the README / documentation and ensure is properly displayed (if necessary)
  • Provide JIRA issue id (if possible) or GitHub issue id in commit message

@admirsaheta admirsaheta requested a review from a team as a code owner March 13, 2024 09:33
@github-actions
Copy link

github-actions bot commented Mar 13, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@admirsaheta
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@admirsaheta
Copy link
Author

recheck

@sfc-gh-rsavenok
Copy link
Collaborator

Hi! I am very sorry for the long delay in getting back to this.

I'm having trouble replicating the issue. Since the node agent is a function and not a class (ref: https://github.com/nodejs/node/blob/main/lib/_http_agent.js#L90-L94), Agent.apply should work across node versions:

Version LTS? https.Agent definition
v10.0.0 LTS function Agent(options)
v15.0.0 non-LTS function Agent(options)
v18.0.0 LTS function Agent(options)
v19.0.0 non-LTS function Agent(options)
v20.0.0 LTS function Agent(options)
v21.0.0 non-LTS function Agent(options)
v23.0.0 non-LTS function Agent(options)
v24.0.0 LTS function Agent(options)
main (future) function Agent(options)

I’ll close this for now, but if you are still seeing this, please open an issue with your environment details, and I'll take another look.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2026
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.

2 participants