-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
compat(node/https): ClientRequest.setTimeout is not a function #17852
Comments
The exact same error occurs when using import * as https from 'https://deno.land/[email protected]/node/https.ts';
const request = https.request({method: 'GET', host: 'discord.com', path: 'https://discord.com/api/v10/gateway', headers: {"User-Agent": "DiscordBot"}});
request.setTimeout(10000);
request.end();
request.on('response', response => {
response.on('data', data=>console.log(data.toString()));
response.on('end', ()=>console.log('ok'));
}); I get >deno run -A --unstable httpsTest.js
error: Uncaught TypeError: request.setTimeout is not a function
request.setTimeout(10000);
^
at file:///D:/usb/compatTest/httpsTest.js:3:9 |
Also, there is another bug if you will remove the setTimeout line, due to std having a different url parser. Node parses it properly. |
Can you report it as a separate issue? |
I will, just noticed it. |
I'll take a stab at this one! |
@luk3skyw4lker, are you still planning on tackling this one? Otherwise, I can give it a crack. |
@iuioiua You can do it! I didn't manage to see it through |
Any updates @iuioiua? If not, I'd love to take a shot at this one. |
I haven't started work on this. Be my guest! 🤙🏾 |
@gamer0mega Were you affected by this issue when you are using some actual npm modules in Deno? |
This issue is 6 months old and i had it when i tried to use an npm |
Having the issue as well when using ethers.js |
Same issue trying to use note: this is on windows Example code with the problem: https://gist.github.com/barthuijgen/37b19fad82b8f584477ef94052caa702 |
Fixed in d137501 |
Describe the bug
ClientRequest.setTimeout in node/https erroring and saying that it is not a function, which is incompatible with node's https module and will break projects which use the compat mode.
Steps to Reproduce
Expected behavior
The code should return this, as on node.
Environment
The text was updated successfully, but these errors were encountered: