brianc / node-postgres

PostgreSQL client for node.js.
https://node-postgres.com
MIT License
12.37k stars 1.23k forks source link

Stop using const enums, as it breaks environments with babel and isolatedModules #2481

Open bart-opplane opened 3 years ago

bart-opplane commented 3 years ago

Const enums (like the ones in https://github.com/brianc/node-postgres/blob/master/packages/pg-protocol/src/messages.ts) are a feature specific to Typescript projects built with tsc compiler. Builds that do not use tsc and only compile explicitly imported files need the --isolatedModules flag enabled, which does not suppport const enums

Please replace const enums with normal enums.

bart-opplane commented 3 years ago

2473