Add "type: module" and fix the exports#16
Conversation
|
Not sure if I want to turn this into an esm package. Goal is to keep as commonjs as is. Going to close issue. If want to add configs so esm and cjs can add but I believe already there. This was a side project did a while back not so much time available for this. I am closing issue keep being awesome |
|
For the record: this is not an improvement. The module is not usable in recent TypeScript configurations. It just cannot be imported, i.e. it is unusable. |
any chance can pass along more details? It currently compiles to CJS, for instance are you asking that it be made compatible with ESM too? This pull request is adding type: "module" which will make it ESM instead of CJS breaking current CJS builds. Did you take that into consideration? |
|
Sure, here is the minumim reproducible code: Steps:
It cannot be started. The error is: About:
I don't mind if we fix it any other way, the only thing it matters is to make it working. We use many different libraries, both CommonJS and ESM, this was the first library with which we had problems. Thanks, |
|
Nodejs 24 is current/experimental and not Lts, so it doesn't make sense to support 24 |
|
The problem isn't in NodeJS. The same happens with an older version, e.g. |
|
It's not supposed to be used using npm start |
|
Feel fee to run the commands directly and you will see the result is the same:
|
|
You are supposed to import the html to adf function |
|
If you unzip the provided file and read the source, you will see that the code inside was copyied directly from the documentation of the module: adding the suggested changes fixes the issue. They might be not the right ones, but if so, please, feel free to fix it the right way. Properly working module is what community needs. |
|
Ok I will look over it over the weekend. Maybe add some documentation on how to use |
1 similar comment
|
Ok I will look over it over the weekend. Maybe add some documentation on how to use |
Hello,
package.jsonand exports to satisfy the TypeScript compiler in more recent configurations, e.g.:package-lock.jsonare only automatically done bynpm audit fix, since there were several vulnerabilities in different dependencies.Thanks,
Iliyan