-
-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: node-postgres broken with ESM #505
Comments
If your project is ESM, do |
OK, I see what the issue is. Weird, because it worked when I tested with raw Node in ESM mode. |
The thing is, I don't think we could simply do |
Apologies, I forgot to include the version of |
Also not working for me. No way to setup Drizzle ORM now. |
Bewest version of drizzle-orm isnt working.. I have to downgrade to ^0.24.2 |
What version of
drizzle-orm
are you using?0.25.1
What version of
drizzle-kit
are you using?0.17.5
Describe the Bug
The above when run produces the stack trace:
It's attempting to read
.setTypeParser
from thepg
module. I've traced it down to the lines thatimport * as pg from 'pg
. Becausepg
is commonjs and seems to only domodule.exports =
from its main module, the importedt
looks like{ default: mainmodule }
instead ofmainModule
. If you change those toimport pg from 'pg'
that should fix it, or wherever you referencepg.setTypeParser()
and any other pg properties, you just addpg.default.
. I'll submit a PR when I get some free time later today.Expected behavior
No response
Environment & setup
I've run across the same error with node
18.16.0
,19.9.0
and20.0.0
.The text was updated successfully, but these errors were encountered: