-
Notifications
You must be signed in to change notification settings - Fork 16
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
Postgres connector: The requested module 'pg' does not provide an export named 'Client' #62
Comments
As I can see, Nitro's build output is in DB0 outputs both mjs and cjs files. cjs file's build is updated to handle the case in build process and has On the other hand, import statement uses destructured imports which is causing the issue. This might be because, |
After running above fix on the provided reproduction, I can verify that the issue gets resolved. |
Seems esm imports not work at all in pg. brianc/node-postgres#3060 brianc/node-postgres#2534 ClientConfig also not imports in my project. Same env as TS, but on Nuxt. |
Environment
Node.js: Reproducible with
v18.18.0
andv21.6.2
[email protected]
[email protected]
Reproduction
https://stackblitz.com/edit/github-xvw4kq?file=package.json
Describe the bug
Given the following configuration:
The server fails to start because the
Client
import from "pg" does not seem to be exported.Additional context
I'm not sure what's happening here, but I can run this with no issue.
I tried integrating without nitro's
useDatabase
withpg
, and I am obliged to instantiate the client this way:Logs
The text was updated successfully, but these errors were encountered: