Skip to content
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

Silent Failure node v14 #22

Closed
vtdiep opened this issue Oct 20, 2020 · 3 comments
Closed

Silent Failure node v14 #22

vtdiep opened this issue Oct 20, 2020 · 3 comments

Comments

@vtdiep
Copy link

vtdiep commented Oct 20, 2020

Issue:
pgtools fails to return a status when run.
This happens in cli and programmatic use.

Reproduce problem:
Using node v14.14.0, postgres v13.0
Attempt to connect with an invalid configuration or with a valid configuration. In both cases, nothing is returned. The callbacks are ignored, no errors or notice of success is displayed.

I've tested that this problem does not occur in node v12.18.3, postgres v12.4
I suspect that this is an issue with node v14.
A similar issue seems to be happening in sequelize/sequelize#12158
What seemed to work there was updating the pg dependency.

Solution:
This is what @sohel-ahmed-ansari proposes #21, which solves this issue.
I've tested that solution on node v14.14.0 and I only did simple tests but it seems to work properly.

How I tested that:

  • npm install npm-force-resolutions
  • add to package.json "resolutions": { "pg": "8.4.0", "pg-connection-string": "2.4.0" }
    and new npm script
    "preinstall": "npx npm-force-resolutions"
    Source: https://stackoverflow.com/a/62956076

To avoid this workaround, one can also do manually what pgtools does: use pg directly, connecting to a default database first.

@EyePulp
Copy link

EyePulp commented Oct 29, 2020

PR #21 corrects the problems I'm having under node v14. Hoping this gets published soon.

@adriaandotcom
Copy link
Collaborator

Will merge that PR after the tests aren't failing anymore (by removing Node.js 5 support).

@adriaandotcom
Copy link
Collaborator

Published version 0.3.1 to NPM with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants