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

npm:pg Top-level await promise never resolved #28543

Open
sant123 opened this issue Mar 18, 2025 · 3 comments
Open

npm:pg Top-level await promise never resolved #28543

sant123 opened this issue Mar 18, 2025 · 3 comments

Comments

@sant123
Copy link

sant123 commented Mar 18, 2025

Version: Deno 2.2.4

Hello, please run this code:

import pg from "npm:pg";

// Fill it with credentials
const client = new pg.Client({
  user: "",
  password: "",
  host: "",
  database: "",
  ssl: true,
});

await client.connect();

const result = await client.query("select * from some_table");
console.log(result);

await client.end();

Errors with the following:

error: Top-level await promise never resolved
await client.end();
^

Image

The only workaround I find is to call client.end() without await. However the code above works with Node.js.

Thanks!

@marvinhagemeister
Copy link
Contributor

Wondering if this is related to the ssl: true option. I'm not able to reproduce it without that locally.

@marvinhagemeister
Copy link
Contributor

marvinhagemeister commented Mar 19, 2025

Could be related to #28526

@oscar6echo
Copy link

possibly related to #28551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants