sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.32k stars 936 forks source link

Failing with deno #2387

Open kesavkolla opened 4 weeks ago

kesavkolla commented 4 weeks ago

Describe the bug

Actual behavior

Uncaught RequestError: The "listener" argument must be of type function. Received an instance of Object at Request._beforeError (file:///home/kesav/.cache/deno/npm/registry.npmjs.org/got/14.4.3/dist/source/core/index.js:183:21) at Request.flush (file:///home/kesav/.cache/deno/npm/registry.npmjs.org/got/14.4.3/dist/source/core/index.js:172:18) at __nodeinternal (ext:deno_node/internal/validators.mjs:283:13) at checkListener (ext:deno_node/_events.mjs:116:3) at HttpsClientRequest.once (ext:deno_node/_events.mjs:537:3) at new ClientRequest (node:http:172:12) at new HttpsClientRequest (node:https:73:79) at request (node:https:123:10) at Request._makeRequest (file:///home/kesav/.cache/deno/npm/registry.npmjs.org/got/14.4.3/dist/source/core/index.js:838:37) at Request.flush (file:///home/kesav/.cache/deno/npm/registry.npmjs.org/got/14.4.3/dist/source/core/index.js:158:24) at eventLoopTick (ext:core/01_core.js:175:7) ...

Expected behavior

The text from the request ...

Code to reproduce

import {got} from 'npm:got';
await got.get('https://www.google.com').text()
...

Checklist

katsanva commented 3 weeks ago

Not reproducible on deno@2.0.4 and got@14.4.3, maybe related to https://github.com/denoland/deno/pull/26264. Please update on your side.