Skip to content
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

CommonJS #59

Open
HaTiIn opened this issue May 29, 2024 · 9 comments
Open

CommonJS #59

HaTiIn opened this issue May 29, 2024 · 9 comments

Comments

@HaTiIn
Copy link

HaTiIn commented May 29, 2024

Hi,

could you please release this module as a CommonJS module, i.e. with the help of "dual-publish" ?

Best regards,
Hans

@nilzona
Copy link
Contributor

nilzona commented May 30, 2024

We have decided to do ES-module javascript only on this library.

What is your use case?

@HaTiIn
Copy link
Author

HaTiIn commented May 31, 2024

That is a pity. I have already tried to migrate my application to ESM. After several days I gave up because there were so many hurdles for which I could not find a solution. Many other developers seem to have had the same experience if you look at the daily downloads of “ESM”-only modules. From my point of view, CommonJS is the standard used in NodeJS.

@nilzona
Copy link
Contributor

nilzona commented May 31, 2024

and the support for using dynamic import to load es-modules from commonjs will not help you here?

@HaTiIn
Copy link
Author

HaTiIn commented May 31, 2024

I tried several fixes, but it ends in ERR_REQUIRE_ESM. If I manage to load the qlik-ap-ts module, then it fails with one of its dependencies: nanoid.

@HaTiIn
Copy link
Author

HaTiIn commented May 31, 2024

see: ai/nanoid#365

@nilzona
Copy link
Contributor

nilzona commented Jul 3, 2024

@HaTiIn .. coming back to this. In your ES-module update journey. Was it only @qlik/api that gave you these issues?

The nano-id issue can be fixed by bundling the code from that specific dependency.

@HaTiIn
Copy link
Author

HaTiIn commented Jul 3, 2024

Was it only @qlik/api that gave you these issues?

Yes.
I solved it by forking your project and babel it to CommonJS with nano-id 3.

@nilzona
Copy link
Contributor

nilzona commented Jul 3, 2024

so would it help you to have the nano-id code bundled inside @qlik/api ?

@HaTiIn
Copy link
Author

HaTiIn commented Jul 3, 2024

no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants