Example failed to run: `pg` does not provide an export named `Pool`
I'm trying to run the example from the
README
file. I made a minial version, installed pg
, @types/pg
, drizzle-orm
and drizzle-kit
and tried to run it via tsx
.
This is my stripped down example:
This is my tsconfig.json
:
Running it:
5 Replies
Weird. Could you try running it with esbuild-register or ts-node? Also, is your project in ESM mode?
Also, doesn't seem to be related to Drizzle, cause the error come from pg.
@bloberenober I removed the
"type": "module"
now from my package.json and it seems to solve this, thanks!
However I do not understand why this error occured because of this
Do you have a link or keyword I can google to understand this behaviour?Well, it's related to ESM support in general. A lot of libraries are only built with CommonJS support and thus are incompatible with ESM. You can just search for ESM vs CommonJS in general, I guess.
thanks, will do this!
try