Fix for client-node ESM v Commonjs issue.#132
Conversation
Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
f5c3cc8 to
e062256
Compare
|
Thanks for the PR, @Tatsinnit! It looks great! Could you add some notes in the description for future reference in case we need to revisit this PR for a similar issue? |
Thank you @bosesuneha , essentially there is no silver bullet for these fixes but I am about to gist the key thing and starting point how we will handle. Information built-up:
For this specific case adding babel did the magic and then this: https://jestjs.io/docs/ecmascript-modules came handy. ESM vs CommonjsESM:ESM also known as (ECMAScript Modules):
CommonJS
I am sure there is more but hope this gives some insight as to how I thought this could be solved until it was all good and green. Thanks. |
ReinierCC
left a comment
There was a problem hiding this comment.
Great solution! and thanks for the explaination!
This PR is open with intent to fix #130
This PR addresses and fixes the issue where the Kubernetes client (@kubernetes/client-node) had compatibility problems with ESM (ECMAScript Modules) and CommonJS. This PR fix resolves the syntax errors related to the use of export in CommonJS contexts and ensures smoother integration.
Additionally, it includes the necessary adjustments to configuration and module handling, improving the overall compatibility with newer module systems.
Thanks heaps, ❤️