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

[Bug] "Request failed." error since deno 2.1.5 (npm:twitter-api-v2) #27847

Closed
Blocksnmore opened this issue Jan 28, 2025 · 3 comments · Fixed by #27971
Closed

[Bug] "Request failed." error since deno 2.1.5 (npm:twitter-api-v2) #27847

Blocksnmore opened this issue Jan 28, 2025 · 3 comments · Fixed by #27971
Assignees

Comments

@Blocksnmore
Copy link

Blocksnmore commented Jan 28, 2025

Version: Any above 2.1.5, tested on 2.1.6 and 2.1.7 as well

I utilize the twitter-api-v2 package and noticed that starting on the 23rd I started getting this request failed. error on Deno Deploy. Upon investigating locally whenever I try to do any api request via the package using deno 2.1.5 or newer it gives an error but version 2.1.4 works fine. I've also tested my code on both node and bun and it works fine there.

Image

Code: https://gist.github.com/Blocksnmore/78e3d5280f4e7e941191eb62bde47773

@kt3k kt3k self-assigned this Jan 28, 2025
@kt3k
Copy link
Member

kt3k commented Jan 28, 2025

This might be related to dns resolution timeout issue.

What happens if you add the below script at the top of your script?:

import net from "node:net";
net.setDefaultAutoSelectFamilyAttemptTimeout(5000);

@Blocksnmore
Copy link
Author

This might be related to dns resolution timeout issue.

What happens if you add the below script at the top of your script?:

import net from "node:net";
net.setDefaultAutoSelectFamilyAttemptTimeout(5000);

Unfortunately this does not resolve the issue (tested on 2.1.7), I'm given the following stack trace using the same code as before alongside your addition at the top

error: Uncaught (in promise) Error: Request failed.
    at RequestHandlerHelper.createRequestError (file:///home/blocks/.cache/deno/npm/registry.npmjs.org/twitter-api-v2/1.19.0/dist/cjs/client-mixins/request-handler.helper.js:58:16)
    at RequestHandlerHelper.onSocketCloseHandler (file:///home/blocks/.cache/deno/npm/registry.npmjs.org/twitter-api-v2/1.19.0/dist/cjs/client-mixins/request-handler.helper.js:218:32)
    at Socket.emit (ext:deno_node/_events.mjs:405:35)
    at node:net:1157:14
    at processTicksAndRejections (ext:deno_node/_next_tick.ts:28:11)
    at runNextTicks (ext:deno_node/_next_tick.ts:76:3)
    at eventLoopTick (ext:core/01_core.js:184:21)

@kt3k kt3k changed the title [Bug] "Request failed." error since deno 2.1.5 [Bug] "Request failed." error since deno 2.1.5 (npm:twitter-api-v2) Jan 29, 2025
@Blocksnmore
Copy link
Author

I can confirm that this issue still occurs on the latest version of deno (2.1.9)

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

Successfully merging a pull request may close this issue.

2 participants