Open
Description
node-postgres/packages/pg-protocol/package.json
Lines 7 to 18 in 9bfc967
It seems that by adding the new "exports" flags to package.json
, now when compiling anything depending on pg
(and relatively @types/pg
) using the bundler
module resolution fails with:
│ /home/runner/work/lib-sqs/lib-sqs/node_modules/@types/pg/index.d.ts
│ 12:31 Cannot find module 'pg-protocol/dist/messages' or its corresponding type declarations. [TS2307]
│ | import { NoticeMessage } from 'pg-protocol/dist/messages';
I think the correct definition for the dist
export in package.json
should be something like the following:
"exports": {
".": {
"import": "./esm/index.js",
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"default": "./dist/index.js"
},
"./dist/*": {
"types": "./dist/*.d.ts",
"require": "./dist/*.js"
}
}
Nothing in dist
seems to be an ESM module (so no "import") and types
and extensions should be explicit...
Metadata
Metadata
Assignees
Labels
No labels