porsager / porsager/postgres

CONNECT_TIMEOUT with npm module on Deno

Open
#723 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
8.7k
Forks
374
Avg merge
11d 16h
Merged PRs (30d)
1

Description

Deno interoperability with npm has come a long way. We'd like to use the Deno runtime without any deno-specific dependencies. If we could use the postgres npm module instead, this would allow us to manage dependencies in package.json instead of deno.json, get rid of the buggy Deno tooling for VSCode, and create code that works on both Node and Deno.

Unfortunately, when I try postgres@3.4.3 with Deno, I get a connection timeout, while the same code works with the deno port.

Error: write CONNECT_TIMEOUT undefined:undefined
    at connectTimedOut (file://my-project/node_modules/.deno/postgres@3.4.3/node_modules/postgres/src/connection.js:257:20)
    at Timeout.done [as _onTimeout] (file://my-project/node_modules/.deno/postgres@3.4.3/node_modules/postgres/src/connection.js:1035:8)
    at cb (ext:deno_node/internal/timers.mjs:63:31)
    at Object.action (ext:deno_web/02_timers.js:151:11)
    at handleTimerMacrotask (ext:deno_web/02_timers.js:65:10)
    at eventLoopTick (ext:core/01_core.js:189:21)
    at cachedError (file://my-project/node_modules/.deno/postgres@3.4.3/node_modules/postgres/src/query.js:170:23)
    at new Query (file://my-project/node_modules/.deno/postgres@3.4.3/node_modules/postgres/src/query.js:36:24)
    at sql (file://my-project/node_modules/.deno/postgres@3.4.3/node_modules/postgres/src/index.js:112:11)

Any chance to get this resolved?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the timeout with postgres@3.4.3 under Deno and compare it with the working Deno port. Start from the connection path shown in src/connection.js, with query.js and index.js as nearby entry points; done means the npm module connects successfully under Deno without CONNECT_TIMEOUT.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno, javascript, postgres
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.