-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Random.js fails to update DB on Node v14.5.0 #12
Comments
Actually, I found that the postgraphile client has a similar issue of being unable to connect, until postgraphile and a couple other packages are updated. Therefore, rather than updating
However, once these packages are updated, I found that it requires that your database password be supplied (in the connection string, or as an environment variable), otherwise you get this error (for both the client and the
You can see the issue described here: I fixed it by supplying the database password, using an environment variable (and then opening a new shell):
In summary, two changes need to be made for the demo to work in Node 14.5+:
Would one or both of these changes be acceptable as a pull request? Or is there a different solution available/preferred? (I'm very new to Postgraphile, and am just trying to get this live-query demo working for now, so I can evaluate its flexibility and such. With the changes above, I've managed to get the data loading on the demo page. However, the live-queries appear to not be updating; so my next task is figuring out what's wrong with the live-query system. EDIT: The live-query issue was just due to me compiling the |
Hey 👋 Yes updating the dependencies would be very welcome as a single PR; you should be able to do this by deleting As for the key issue, I think this might be related to your setup? I've not experienced that issue on Mac or Linux. I'm guessing you can fix it by using a subtly modified (e.g. more explicit) connection string? I'm not sure if that makes sense as a PR - it's been a while since I've been in the guts of this project - feel free to raise one if it's minimal effort and we'll go from there 👍 Thanks 🙌 |
Summary
The "pg" module used by "random.js" is outdated; it silently fails to connect on Node v14.5.0.
Steps to reproduce
Run the "random.js" script, with Node v14.5.0; no errors will be shown, but code will fail to perform any update operations. (the awaited promise in
random()
simply never resolves)Expected results
I expect to see the "ranking" cells in the "people" table update, from the execution of the timer in
random.js
.Actual results
No database updates are performed. (confirmed by checking with pgAdmin)
Additional context
OS: Windows 10
PostgreSQL: 13.1
Node: 14.5.0
Possible Solution
I ran
yarn add pg@latest
, and afterward therandom.js
script began successfully updating thepeople
table.I found this solution (updating the
pg
module) from the following comment: brianc/node-postgres#2317 (comment)The thread shows other people with the same issue, and some discussion on the source of the issue. (apparently due to an update to the Node
stream
module)The text was updated successfully, but these errors were encountered: