You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deno's node:http module behaves differently than Node.js's http module when using http.request with the socketPath option to connect to the Docker socket.
Instead of connecting to the Docker socket, Deno appears to attempt a TCP connection to http://localhost/info, resulting in an ECONNREFUSED error.
This discrepancy was discovered while troubleshooting a failure using @testcontainers/postgresql library and was traced down through its dependencies (dockerode, docker-modem) to this minimal reproduction.
The equivalent code works perfectly in node, indicating a failure in Deno.
Reproduction Steps:
1. Setup:
Install Docker Desktop on macOS.
Ensure the Docker daemon is running and accessible via the default Unix socket: /Users/<your_username>/.docker/run/docker.sock (replace <your_username> with your actual username).
Make sure you have "Allow the default Docker socket to be used" enabled under advanced settings in Docker.
2. Node.js (Correct Behavior):
Create a file named node-test.js with the following content:
Ensure you set "type": "module" in package.json.
Summary:
node:http
module behaves differently than Node.js'shttp
module when usinghttp.request
with thesocketPath
option to connect to the Docker socket.http://localhost/info
, resulting in anECONNREFUSED
error.@testcontainers/postgresql
library and was traced down through its dependencies (dockerode
,docker-modem
) to this minimal reproduction.Reproduction Steps:
1. Setup:
/Users/<your_username>/.docker/run/docker.sock
(replace<your_username>
with your actual username).2. Node.js (Correct Behavior):
Create a file named
node-test.js
with the following content:Ensure you set
"type": "module"
inpackage.json
.Run:
node node-test.js
3. Deno (Incorrect Behavior):
deno-test.ts
with the following content:Run
deno -A deno-test.ts
Environment:
The text was updated successfully, but these errors were encountered: