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

Upgrade to 0.22.2 fails due to use of new major version of client-node. #2014

Open
TonyJDavies opened this issue Nov 4, 2024 · 7 comments
Open

Comments

@TonyJDavies
Copy link

Describe the bug
When upgraded to latest version 0.22.2 of this library getting the following error:

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/app/node_modules/openid-client/build/index.js from /home/app/node_modules/@kubernetes/client-node/dist/oidc_auth.js not supported.
Instead change the require of index.js in /home/app/node_modules/@kubernetes/client-node/dist/oidc_auth.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/app/node_modules/@kubernetes/client-node/dist/oidc_auth.js:5:35)
    at /home/app/node_modules/@kubernetes/client-node/dist/oidc_auth_delayed.js:44:70
    at async DelayedOpenIDConnectAuth.applyAuthentication (/home/app/node_modules/@kubernetes/client-node/dist/oidc_auth_delayed.js:44:22)
    at async KubeConfig.apply(--- cut ---)
    at async KubeConfig.applyOptions (/home/app/node_modules/@kubernetes/client-node/dist/config.js:388:9)
    at async KubeConfig.applyToRequest (/home/app/node_modules/@kubernetes/client-node/dist/config.js:110:9)

This appears to be due to using the new version of client-node.
** Client Version **
0.22.2

** Server Version **
e.g. 1.19.1

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

** Example Code**
Code snippet for what you are doing

Environment (please complete the following information):

  • OS: [e.g. Windows, Linux]
  • NodeJS Version [eg. 10]
  • Cloud runtime [e.g. Azure Functions, Lambda]

Additional context
Add any other context about the problem here.

@brendandburns
Copy link
Contributor

I'll try to repro this. I would have thought that the unit tests for this code would have failed though.

Do you have a snippet of code that reproduces this?

Also, what version of Node are you using?

@cjihrig
Copy link
Contributor

cjihrig commented Nov 4, 2024

It looks like #1969 bumped the openid-client dependency from 5.7.0 to 6.1.3. Looking at the v6.0.0 release notes, that dependency switched to being an ESM module. Since the TypeScript code is transpiled to use require(), I'm guessing that explains the error.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 4, 2024

I would have thought that the unit tests for this code would have failed though.

Similar to what I mentioned in #1975 - it might be worth running the tests against the transpiled code.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 18, 2024

I'm curious what the maintainers would think about reverting #1969 on the v0.x release line, and using this as a reason to move the 1.x release line to ESM. I think that would cause the fewest future headaches.

@mstruebing
Copy link
Member

@brendandburns I think that would be a very valid breaking change.
what do you think?

@cjihrig
Copy link
Contributor

cjihrig commented Nov 23, 2024

@brendandburns do you have any thoughts on #2014 (comment)?

@brendandburns
Copy link
Contributor

I'm ok with that.

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

4 participants