node 14 causing unknown issues for graphqljs
Asked Answered
C

1

4

So I recently tried upgrading my node from 13 to 14, but afterwards I was having issues with graphql.

What happened was that I was forever "pending" whenever I sent a request to the server. The problem is, there's no errors being thrown.

I'm wondering if anyone has had any issues with graphql when upgrading from 13 to 14.

Packages used:

  • express-graphql
  • graphql
  • graphql-iso-date
  • graphql-query-builder-v2
  • graphql-type-json
  • graphql-upload

If you don't have any problems with node 14 and these two graphql packages, please let me know, as it's then other packages that are causing the issue. Thanks.

My current solution is to downgrade node (I'm currently on node 12 since brew doesn't seem to have node 13 yet).

Cystine answered 4/5, 2020 at 8:20 Comment(9)
Which database are you using?Andromede
@Andromede postgresql, I am using pg-promise to connect to itCystine
Since you are using pg-promise, set the dependency to "pg-promise">=10.5.2, remove node_modules and do fresh install of dependencies. That should fix it for you once and for all. Also see my comment to the answer by madflow.Brittaneybrittani
@Brittaneybrittani it was definitely caused by pg. I'm pretty sure it's a dependency, so it's being used somewhere. Updating it fixed the perpetual pending.Cystine
@Brittaneybrittani i realize that I was also using connect-simple-pg, so I think that was the main culprit.Cystine
@A.Lau If pg is used somewhere else in your project, directly, outside pg-promise, then yes, sure, you would have to set pg>=8.0.3, but if you only use pg-promise as a dependency in your project, then setting it to the right version and reinstalling will suffice.Brittaneybrittani
About connect-simple-pg, yes, that would cause the problem, and you indeed would have to force the version of pg by setting it explicitly.Brittaneybrittani
@Brittaneybrittani it was a mess of a code. I switched to using jwt instead, since I needed to use pg to create a pool. Great library btw.Cystine
I have just opened a new issue there.Brittaneybrittani
A
3

There is a known issue in the pg module and NodeJS 14. Since pg-promise also uses this module - I suspect this is the problem.

The proposed solution is to make sure you have pg>=8.0.3 installed.

This can be done by

  • updating to pg-promise>=10.5.2 which already has the updated pg module as a dependency and/or
  • updating to pg>=8.0.3 in the dependencies if explicitly specified.

Also make sure that any other library depending on pg is up to date.

Andromede answered 4/5, 2020 at 8:34 Comment(4)
i will try it tomorrow, seems like a logical connection, thanks.Cystine
This doesn't seem right. The author stated that he is using pg-promise, which since v10.5.2 had pg driver version fixed at 8.0.3. This means the right solution is to have "pg-promise">=10.5.2, and not pg>=8.0.3.Brittaneybrittani
@Brittaneybrittani The culprit is the pg module. Some people explicitly pin pg as dependency. So I disagree that this is not "right". I will however update the answer with the additional info :)Andromede
@Andromede See comments within the question. The culprit is pg-connect-simple, for which I have opened a new issue. Other than that, if one does not include other modules with their own pg dependencies, then updating pg-promise dependency as specified is the right way. So in your answer the best thing is to explain it that way.Brittaneybrittani

© 2022 - 2024 — McMap. All rights reserved.