D
Deno

help

`Uncaught TypeError: encode is not a function` when using npm module `@kubernetes-client/node`

Bbergehurra8/12/2023
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
Ttr1ckydev8/13/2023
Deno
Node.js compatibility mode | Manual | Deno
Starting with v1.15 Deno provides Node compatiblity mode that makes it possible to run a subset of programs authored for Node.js directly in Deno. Compatiblity mode can be activated by passing `--com
Ttr1ckydev8/13/2023
try compat flag
Bbergehurra9/1/2023
--compat was removed in Deno 1.25.2, since the npm: style import was introduced. I don't think this is an import problem as such, it kind of looks like some sort of implementation error in the querystring emulation layer in Deno, right? For what it's worth, this appears to be fixed as of Deno 1.36.3.
Hhpx712/17/2023
is this fixed for you? i'm still running into it with Deno 1.39.0
CCandeia12/29/2023
Same here
ASAntonio Sampaio12/31/2023
have you guys seen the code on the stack trace? I'll try to look at it when I go to the PC Also.. what about tô use the deno.land alternative??? I use and love it
Bbartlomieju12/31/2023
This is getting fixed in 1.39.2
ASAntonio Sampaio12/31/2023
<:party_deno:1035517691517218847>
CCandeia1/5/2024
I can confirm that was fixed!
Hhpx71/12/2024
is anyone else running into cert issues with @kubernetes/client-node and Deno? I can only get it to run with --unsafely-ignore-certificate-errors, otherwise I run into this issue: https://github.com/denoland/deno/issues/2301
CCandeia1/19/2024
Yes you need to since kubernetes uses self-signed certs @hpx7

Looking for more? Join the community!

Recommended Posts
Linking to external codeif i want to link to external code, do i have to import it from https://deno.land?Impossible to install Deno on Linux Ubuntu LTS (22.04) x86_64Hello Context & Tech : Trying to install Deno on Linux Ubuntu LTS v22.04 on x86_64 architecture PrGet length of video (stream. m3u8)In deno/typescript, how can i get the length of a specific video stream (m3u8)?github account blocked errori changed email my old account to another account and when i login to deno deploy with that account npm:axios not returning anythingI'm trying to troubleshoot a problem with axios (the same snippet works fine on node). I'm callingextension method returning undefined for `text/plain`Given the following: ```ts console.log( "text/plain", extension("text/plain"), extensioServing multiple static files to an HTTP requestIf a client sends a request for an array of static files names like so. ```["component01.js", "compoKv encodes integer as doubleAnyone know why Deno.kv encodes an integer in a mutli-part key as a double? ``` const key = ["int",Looking for caching API ResponsesHello there, I'm looking for a package/or examples to cache API responses for a fresh project whicUsing ZeroMQ from NPMAnyone got fixed the same error as this issue? https://github.com/denoland/deno/issues/18345Trying to pass parameters to runtime from rustHi, I'm launching a deno runtime from my project's code. I'm trying to pass some dynamic json variconsole.log in a worker - capture or hide output?Running under `deno repl` with no permissions, this prints 'yee'. In a browser's dev tools it would Deno debugging configuration is missing?```json "deno.enable": true, "deno.unstable": true, "deno.enablePaths": ["./api"], "deno.docIs there a way to show permissions used on start up during runtime?For example: If I was to run an App with `permissions: --allow-net=${hostname}:${port}` is there a wrestrict path applied for import mapshi, is it possible to restrict importmap application to only specific path? the rationale is: - vscoBest way to pass backend data to SSR rendered view?Looking for the "proper" way to pass data to an SSR rendered view. My first idea is setting custom pImport mapHi I have this in deno.json: ``` "imports": { "./app.controller": "./app.controller.ts", ``` butWhat should I specify to pass a "char *" in Deno.dlopen?For example, this is how you would use it in Python: ```python import ctypes lib = ctypes.cdll.LoadOverride NPM package dependencyRelating to my question yesterday (https://canary.discord.com/channels/684898665143206084/1137532072VS Code's debugger terminates before finishedI notice that occasionally the debugger terminates at the middle of the running, or at least doesn't