-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Calling createReadStream() for uploaded file crashes in NodeJS 13 #3508
Comments
I am having the sam issue, but only when app is in production. |
@biomazi Well, I decided to use Node 12 until this issue is fixed |
This seems to be a problem with an older version of fs-capacitor According to jaydenseric/graphql-upload#170 the fix is checked in to master already and awaiting publish soon until then, merging this into package.json will work. The preinstall script is only needed if using npm, as yarn supports dependencies natively
|
graphql-upload 9.0.0 is out with node 13 support |
graphql-upload 10.0.0 is out |
Adding this here in case it helps someone else. After trying everything listed above I couldn't get it to work (even on Node 12??). Anyways I discovered I had Far from a perfect solution, but ¯_(ツ)_/¯ |
This seems like a pretty serious bug. I'm surprised that it is still open.. |
Same issue here, any updates? |
@safead For me it showed up in production build inside docker containers, downgrading node to the last LTS helped |
I downgraded to Node 12 and worked. |
Same issue here |
Fixes keystonejs#2101. Currently, apollo-server-express depends on apollo-server-core which depends on graphql-upload ^8.0.2. graphql-upload 9.0.0 updated its own fs-capacitor dependency to a newer version that supports Node 13, but apollo-server-core hasn't updated its own graphql-upload dependency yet. Solve this by just forcing a compatible version of graphql-upload (currently the latest 10.0.0) to be used.
Yeah downgraded the node version, make it work. But not a right solution. |
Having the same issue. However check this workaround instead of downgrading: MichalLytek/type-graphql#37 (comment) more specifically for people using type-graphql. |
Same here, downgrading to 12. |
Isn't it about time to fix this? Node v14 is out with release status LTS, and here we are still finding support for v13 😕 |
Thanks! Half a year passed since I opened this issue and no response from maintainers. I consider switching to https://github.com/mcollina/fastify-gql which is significantly faster , supports subscriptions and have built-in support for loaders |
I'm moving to |
Same here, only in production |
This bug is really a blocker for this module and should be considered top priority for maintainers. A workaround is to force resolution for module graphql-upload to a more recent version : in package.json
be aware that resolutions property is currently only handled by yarn package manager, not by npm with npm, you have to preinstall an aditionnal module to force resolutions :
of cours, check that your CI support preinstall scripts (our don't) |
We are never going to upgrade graphql-upload in Apollo Server v2, and we are going to remove the built-in integration from Apollo Server v3. That's not to say that we don't like graphql-upload: we just think folks should be able to get every new improvement @jaydenseric puts out without needing to tightly couple it to the Apollo Server release cycle. Folks who want to use the newer version of graphql-upload now should follow @abernix 's suggestion in #3508 (comment) to disable the built-in integration and install the I recognize that there may be some integrations (eg Lambda) where there's no easy place to plug in the graphql-upload processRequest function. If that's the case, we can fix that by adding an appropriate hook to the integration that would allow you to insert processRequest (or any handler of your choice!) at the right place, without tightly coupling the implementation to graphql-upload. |
None of the solutions worked for me. The resolutions fix and the graphql manual update didn't work as I'm using apollo-server-lambda. Downgrading my node version to 12 just so I can get apollo working does not seem like a reasonable thing to do. I guess I'm on an island here. |
Downgrading to node 12 removes the error for me but doesn't seem like the correct fix... |
Yes, as mentioned, I don't think there's currently a great solution for integrating a non-built-in use of AS3 is going to remove the built-in I'm the new lead maintainer of AS but I have to admit — I don't use lambda myself, and we don't use it much internally at Apollo. My philosophy is that while So what I'd love to see happen is a PR from somebody in the community that allows you to slot in the newest release of Taking a quick glance at The function also closes over I'd love to review a PR that's something like this! Of course I'm not a Lambda expert so there might be some other much more natural way of implementing this. But basically: let's come up with some non-upload-specific hooks that let you use upstream |
I've filed #4951 to track this. |
Actually, this doesn't fix the error in my case.. Any case like me? My Node version is v.14.9.0 |
@nuggy875 What web server are you trying to use Apollo Server and graphql-upload with? |
I'm using them for GraphQL Server.. |
I have the same problem with node 14x |
@nuggy875 I mean, which |
facing same issue with node 14x |
Actually I don't understand why this issue is closed, since #4922 uses now a fork of graphql-upload 8, which does not support either nodejs >=13 (nodejs 13 support has begun with version 9, see https://github.com/jaydenseric/graphql-upload/releases/tag/v9.0.0) Correct me if I'm wrong, but if I understand correctly, this repo is still not compatible with nodejs >=13 and thus this issue is still pending. |
@abenhamdine This is essentially closed as WONTFIX. Upgrading the version of On the other hand, the plan for AS3 is not to upgrade I encourage you to use My guess is that this will work fine with, say, apollo-server-express, but that this will be challenging for apollo-server-lambda because there's no "middleware" there to let you inject the call to Note that I just landed a PR to rewrite |
Thanks a lot @glasser for this detailled explanation. However I see that all the issues related the the incompatibility with node 13 are closed with a link to the version 2.21 of appolo-server-express. I fail to see how version 2.21 is related to this very problem : version 2.21 allows as of now to use graphql@15, but is still incompatible with node 14 (as you have confirmed above). It was not clear for me what the current situation was (because I don't know what you have modified in your fork of graphql-upload version 8) and I suspect many users of this module are confused as well. And thx again for all your work on this library 👍 |
That's a good point. So far to learn about this you'll have to search for my comments on random GitHub issues. #5039 should be a good start. |
* Switch from using build-in Apollo Server "Upload" functionality to making explicit use of graphql-upload. This has been done to work around a defect handling uploads on NodeJS v14. Uploads have been working ok in containers and in our staging environment, but they were not working when running the server directly on Windows. Now, this works too. Note that Apollo Server currently uses graphql-upload -- the same version that we're using! But we are disabling Apollo Server's default use, and replacing it with our own, explicit express middleware, per apollographql/apollo-server#3508.
…sion: so an Maximum call stack size exceeded error occurs. -> solved as suggested: https://github.com/apollographql/apollo-server/issues/3508\#issuecomment-662371289
Running in NodeJS 13.1.0:
Result:
The text was updated successfully, but these errors were encountered: