Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TypeError: Class extends value undefined is not a constructor or null

Open
#77 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, nuxtjs
Domain
frontend, web-dev

Research direction

Start with the Nuxt 3 import in the .vue page or component and follow the stack trace through cybersource-rest-client.js, agent-base, https-proxy-agent, and ApiClient.js. Determine why http.Agent is undefined in this setup; done means the ApiClient import works without the reported TypeError.

Written by the indexing model from the issue text.

Description

I could be doing something silly, but when I've imported
import ApiClient from 'cybersource-plugin';
into my nuxt3 application in a .vue page or component I get the below error

which seems to be in the cybersource-rest-client.js file where the Agent class extends http.Agent

TypeError: Class extends value undefined is not a constructor or null
    at node_modules/cybersource-rest-client/node_modules/agent-base/dist/index.js (cybersource-rest-client.js?v=6b63f3c9:2676:36)
    at __require2 (chunk-WGAPYIUP.js?v=6b63f3c9:19:50)
    at node_modules/cybersource-rest-client/node_modules/https-proxy-agent/dist/index.js (cybersource-rest-client.js?v=6b63f3c9:2941:24)
    at __require2 (chunk-WGAPYIUP.js?v=6b63f3c9:19:50)
    at cybersource-rest-client.js?v=6b63f3c9:57284:68
    at node_modules/cybersource-rest-client/src/ApiClient.js (cybersource-rest-client.js?v=6b63f3c9:57291:7)
    at __require2 (chunk-WGAPYIUP.js?v=6b63f3c9:19:50)
    at cybersource-rest-client.js?v=6b63f3c9:161311:35
    at node_modules/cybersource-rest-client/src/index.js (cybersource-rest-client.js?v=6b63f3c9:161313:7)
    at __require2 (chunk-WGAPYIUP.js?v=6b63f3c9:19:50)
Dominant language
JavaScript
Stars
43
Forks
66
Avg merge
1d 8h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CyberSource/cybersource-rest-samples-node

All issues in CyberSource/cybersource-rest-samples-node

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.