-
Notifications
You must be signed in to change notification settings - Fork 58
CommonJS not working since jira.js v4.0.5 #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting this issue! To help us investigate the CommonJS compatibility problem after the migration to
For example: // Example that fails in CommonJS
const { JiraClient } = require('jira.js');
// ... This will help us reproduce the issue and work on a solution. If you’re using a bundler (like Webpack) or a specific Lambda runtime, mentioning that would also be useful. |
I'm using jira.js v5.2.0 Code where it's failing to load the jira.js library with first use of the library:
This is partial uncompiled TypeScript source:
Error message:
This is a TypeScript code base and I'm using |
Can I ask you to create a basic playground that I could deploy on AWS (no pipeline needed)? Because I still suspect that you have issues with the project settings |
Here you go: https://github.com/deepwell/lambda-jirajs
Then upload deployments.zip to a new AWS Lambda. Use the Test feature to run the code. |
Could you please try this changes in package.json: {
"name": "jira-reproduce",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"build": "tsc",
"package": "npm run build && cp package.json dist && cd dist && npm install --omit=dev && zip -r ../deployment.zip .",
"test": "jest",
"type-check": "tsc --build ./tsconfig.json"
},
"author": "",
"dependencies": {
"jira.js": "5.2.0"
},
"devDependencies": {
"@types/aws-lambda": "8.10.149",
"@types/node": "22.15.18",
"typescript": "5.8.3"
}
} |
I applied that change, rebuild the package, uploaded it, re-tested, and this is what it returns now:
In tsconfig.json, I changed |
Am I correct in understanding that the issue has been resolved and I can close it? |
I'm working on a project that compiles to commonjs to support another ticketing system (zendesk via
Since this thread describes a workaround, I was wondering if a similar workaround would apply in my case. I've created a minimal example that will break if you run |
If you change the target here to ES6 instead of ES2022, will it work? https://github.com/holatuwol/jira.js/blob/issue-387/tsconfig.json#L3 Or you could add |
Since the migration from mime-types to mime in v4.0.5, the CommonJS build of jira.js is no longer working.
It would be great to support CommonJS builds again for deploying to locations where ESM is not supported (eg: AWS Lambda).
The text was updated successfully, but these errors were encountered: