How to resolve TypeError: Cannot read properties of undefined

I’m using jira-client to create a jira utility

I split my functions into two files but when I try to execute now I get
TypeError: Cannot read properties of undefined

This is the code

changeStatus: function (issueId, transitionId) {
    return new Promise((resolve, rejects) => {
      if (isString(issueId) && issueId.length === 7 && isString(transitionId)) {
          .transitionIssue(issueId, {
            transition: {
              id: transitionId,
          .then((transition) => {
          .catch((error) => {
      } else {
        rejects(`The request cannot be handled as a result of \n
        The issueId ${issueId} is not valid due to \n
          1. The value passed is not a String \n
          2. The value passed is not of length 7 \n
          or \n
          The transitionId ${transitionId} provided is not string`);
checkStatus: function (issueId) {
      .then((issue) => {
        console.log(`Status of the issue is ${issue}`);
      .catch((err) => {
jiraApis.checkStatus("<issueId redacted>")

this call results in TypeError: Cannot read properties of undefined (reading 'findIssue')

Any idea why ?

The code you posted above does not reference anything named findIssue. Somewhere in your code, you are trying to reference findIssue on something that is undefined.

I would perform a search of .findIssue throughout your code and put console.log(the-thing-before-the-dot) before each reference to see which is undefined.

Considering findIssue is a method on the JiraApi instance I would expect it to be defined as long as you have access to the instance.

The code you posted doesn’t really help us. Post a GitHub repo with all the code instead.