Problem
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.
Problem
const { Client } = pgdoes not work — destructuring a named export off a native module's default export throwsundefined is not a constructor.import { Client } from "pg"does work.Why it matters
docs/examples/stdlib/database/snippets.tscontains 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 staticimport { X } from "mod". This is pre-existing and unrelated to the turnloop transport migration.