Closed vichingo closed 9 months ago
Hi,
When trying to find the context id of a field with:
node ./src/index.js
const jira = new Version3Client({ host: url, authentication: { basic: { email: email, apiToken: jiraApiToken, }, }, newErrorHandling: true, }) export const getJiraFields = () => jira.issueFields.getFields() export const getJiraCustomFieldContexts = (fieldID) => jira.issueCustomFieldContexts.getContextsForField(fieldID) export const getJiraCustomFieldOptions = (fieldID, contextID) => jira.issueCustomFieldOptions.getOptionsForContext(fieldID, contextID);
And calling it in my main file with:
const jiraFieldContext = await getJiraCustomFieldContexts(jiraField[0].id);
I get the following error:
node:internal/process/esm_loader:94 internalBinding('errors').triggerUncaughtException(
when I add --trace-uncaught node --trace-uncaught ./src/index.js I get:
node --trace-uncaught ./src/index.js
node:internal/process/esm_loader:94 internalBinding('errors').triggerUncaughtException( ^ Thrown at: at loadESM (node:internal/process/esm_loader:94:31) at processTicksAndRejections (node:internal/process/task_queues:96:5)
The error is caused after using both issueCustomFieldContexts.getContextsForField and issueCustomFieldOptions.getOptionsForContext
issueCustomFieldContexts.getContextsForField
issueCustomFieldOptions.getOptionsForContext
I searched high and low, but the solutions seem to general for me to determine the cause of the error. Does anybody have any insight.
Update:
I found a possible cause: https://nodejs.medium.com/announcing-a-new-experimental-modules-1be8d2d6c2ff
I have indeed set type: module in my package.json
type: module
Hi @vichingo! At the moment we are not supporting ESM in Jira.js
That's unfo. But I solved it. It had to do with me passing the variables in an object and try catch around it
Hi,
When trying to find the context id of a field with:
node ./src/index.js
And calling it in my main file with:
I get the following error:
when I add --trace-uncaught
node --trace-uncaught ./src/index.js
I get:The error is caused after using both
issueCustomFieldContexts.getContextsForField
andissueCustomFieldOptions.getOptionsForContext
I searched high and low, but the solutions seem to general for me to determine the cause of the error. Does anybody have any insight.
Update:
I found a possible cause: https://nodejs.medium.com/announcing-a-new-experimental-modules-1be8d2d6c2ff
I have indeed set
type: module
in my package.json