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
{{ message }}
Repository navigation
const { Client } = pg (destructuring a native module's default export) throws "undefined is not a constructor" #10340
const { Client } = pg does not work — destructuring a named export off a native module's default export throws undefined is not a constructor. import { Client } from "pg" does work.
Why it matters
docs/examples/stdlib/database/snippets.ts contains this exact destructuring pattern as documented, runnable example code. Anyone following the documentation as written would hit this failure immediately.
What would fix it
Whatever resolves a named binding off a CJS-style native module's default export needs to handle plain object destructuring (const { X } = mod) the same way it already handles a static import { X } from "mod". This is pre-existing and unrelated to the turnloop transport migration.
Closing as obsolete: the native pg binding was removed in 6e0f111 (#10677, 2026-09-21); pg now compiles from source. This issue describes the removed native implementation, so it no longer applies. If the same behavior reproduces with the real npm package compiled from source on current main, please open a new issue against that path.
Activity
TheHypnoo commentedon Sep 28, 2026
Closing as obsolete: the native pg binding was removed in 6e0f111 (#10677, 2026-09-21); pg now compiles from source. This issue describes the removed native implementation, so it no longer applies. If the same behavior reproduces with the real npm package compiled from source on current main, please open a new issue against that path.