bergehurra
bergehurra
DDeno
Created by bergehurra on 8/12/2023 in #help
`Uncaught TypeError: encode is not a function` when using npm module `@kubernetes-client/node`
I'm trying to use a particular call in the npm module @kubernetes/client-node from deno, but I'm getting a TypeError, and I'm not sure how to debug it:
0 berge@varmeskapet:~/deno/typeerror> deno run --allow-read --allow-env --allow-sys --allow-run main.ts
error: Uncaught TypeError: encode is not a function
at encodeStringifiedCustom (node:querystring:641:12)
at Object.stringify (node:querystring:683:22)
at Querystring.stringify (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/lib/querystring.js:26:29)
at Request.qs (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/request.js:1223:21)
at Request.init (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/request.js:344:10)
at new Request (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/request.js:127:8)
at DefaultRequest.request [as requestImpl] (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/index.js:53:10)
at DefaultRequest.webRequest (file:///home/berge/.cache/deno/npm/registry.npmjs.org/@kubernetes/client-node/0.18.1/dist/watch.js:15:26)
at Watch.watch (file:///home/berge/.cache/deno/npm/registry.npmjs.org/@kubernetes/client-node/0.18.1/dist/watch.js:75:32)
at async file:///home/berge/deno/typeerror/main.ts:7:1
0 berge@varmeskapet:~/deno/typeerror> deno run --allow-read --allow-env --allow-sys --allow-run main.ts
error: Uncaught TypeError: encode is not a function
at encodeStringifiedCustom (node:querystring:641:12)
at Object.stringify (node:querystring:683:22)
at Querystring.stringify (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/lib/querystring.js:26:29)
at Request.qs (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/request.js:1223:21)
at Request.init (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/request.js:344:10)
at new Request (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/request.js:127:8)
at DefaultRequest.request [as requestImpl] (file:///home/berge/.cache/deno/npm/registry.npmjs.org/request/2.88.2/index.js:53:10)
at DefaultRequest.webRequest (file:///home/berge/.cache/deno/npm/registry.npmjs.org/@kubernetes/client-node/0.18.1/dist/watch.js:15:26)
at Watch.watch (file:///home/berge/.cache/deno/npm/registry.npmjs.org/@kubernetes/client-node/0.18.1/dist/watch.js:75:32)
at async file:///home/berge/deno/typeerror/main.ts:7:1
Code at https://gist.github.com/berge/379b25d2e780ccddf2734773ef6b6bdc. I'm unsure if this is a bug in Deno's nodejs compatibility layer, or something else. (The program works fine in nodejs with typescript.) What's a good place to start investigating? Edit: Deno version:
0 berge@varmeskapet:~/deno/typeerror> deno --version
deno 1.36.1 (release, x86_64-unknown-linux-gnu)
v8 11.6.189.12
typescript 5.1.6
0 berge@varmeskapet:~/deno/typeerror> deno --version
deno 1.36.1 (release, x86_64-unknown-linux-gnu)
v8 11.6.189.12
typescript 5.1.6
14 replies