Open modox94 opened 1 year ago
Hi @modox94,
Can you please tell me your dev environment? Node version, are you using ESM, and MAL Api SDK version?
Thank you!
Hi. I attached package files to message. I use CJM at this repo. I tried to use your package with ESM and it works fine, but I need CJM support. node v16.20.0 npm v9.7.2 package.json.txt package-lock.json.txt
Noted, I'll try to find a way on how to make this work with CJS. Thank you for reporting!
Hi @modox94,
Thank you for waiting, I have consulted with some of my friends that have better understanding with ESM and I have read some blogs about it too. Apparently it's not possible to use newer Got with CJS.
This project uses newer Got, so I need to update it to ESM too. You can actually use dynamic import to replace the require
, but apparently i will need top-level await as well. Unfortunately to use top-level await, your package must be converted to ESM ("type": "module"
in package.json
) as well.
That being said, since I do not use their deeper APIs, I kind of want to try to support older Got version (v11) that still support CJS as well. Hopefully it can still work with this library.
But In the future, I'll drop support for CJS because older got is no longer actively supported. I made mistake when bumping up the major version by not removing the CJS build i copied from my older library project. I'm sorry :(.
I'll update you with my findings. Thank you!
Hi @modox94,
I've published new version so that you can use got
with older version. The tests seems okay, but I have not tested it much further.
To install this new version with older version of got, you can run following commands:
yarn add @chez14/mal-api-lite@^1.2.7 got@^11.8
## or NPM
npm i -s @chez14/mal-api-lite@^1.2.7 got@^11.8 && npm dedupe
Thank you!
Can'r import this package with
require
. Everything ok with modernimport
.