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

Node 13 support #170

Closed
Slessi opened this issue Nov 22, 2019 · 29 comments
Closed

Node 13 support #170

Slessi opened this issue Nov 22, 2019 · 29 comments

Comments

@Slessi
Copy link

Slessi commented Nov 22, 2019

When using this library with Node 13, I receive the following:

uncaughtException: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at ReadStream.deprecated [as open] (internal/util.js:55:22)
    at ReadStream.open (/project/node_modules/fs-capacitor/lib/index.js:90:11)
    at _openReadFs (internal/fs/streams.js:123:12)
    at ReadStream.<anonymous> (internal/fs/streams.js:116:3)
    at ReadStream.deprecated [as open] (internal/util.js:70:15)
    at ReadStream.open (/project/node_modules/fs-capacitor/lib/index.js:90:11)
    at _openReadFs (internal/fs/streams.js:123:12)
    at ReadStream.<anonymous> (internal/fs/streams.js:116:3)
    at ReadStream.deprecated [as open] (internal/util.js:70:15)
    at ReadStream.open (/project/node_modules/fs-capacitor/lib/index.js:90:11)
(node:55196) [DEP0135] DeprecationWarning: ReadStream.prototype.open() is deprecated

This is an issue with fs-capacitor mike-marcacci/fs-capacitor#15 which has been fixed in 3.0.0 so need a version bump on this package

I can resolve this temporarily with this in my package.json

    "resolutions": {
        "fs-capacitor": "3.0.0"
    }

There is now fs-capacitor 5.0.0 as well but haven't tried it

@mike-marcacci
Copy link
Collaborator

mike-marcacci commented Nov 22, 2019

Hi @Slessi - you're correct, adding that resolution should work for the time being. We've already made the changes to incorporate fs-capacitor version 4 (which also has node 13 support), and will be releasing that shortly. Version 5 is identical to 4 from an API standpoint but without bringing in its own stream library to support node version 8. We'll upgrade to version 5 once we can drop support for node 8 (in January, when its LTS expires).

Closing this as it's already fixed in master.

@Slessi
Copy link
Author

Slessi commented Nov 22, 2019

@mike-marcacci nice. You have a plan when that would be released?

I'm using apollo-server which depends on this library and would need to file an issue there also if they don't update

EDIT: Cool I didn't realise fs-capacitor was your own repo :)

@mike-marcacci
Copy link
Collaborator

I believe we'll have a new release after #169 gets finished. Node 12 and 13 changed the way commonjs and es modules work, and removed the mechanism for publishing both in the same library... so this is re-tooling to drop our experimental mjs support.

@gregory
Copy link

gregory commented Dec 2, 2019

Looks like graphql-upload needs to cut a new release since fs-capacitor was bumped to 4.0.0.
Am i missing something @mike-marcacci @jaydenseric ?

see apollographql/apollo-server#3508 (comment)

@jaydenseric jaydenseric pinned this issue Dec 2, 2019
@jaydenseric
Copy link
Owner

@gregory after dogfooding what was on master branch the other day, it came to light that the warnings due to new fs-capacitor behavior need some polish. @mike-marcacci and I have been having discussions about the best way to handle SIGINT, SIGTERM and SIGHUP listeners:

Screen Shot 2019-11-29 at 2 23 58 pm

The conclusion so far is that they need to be handled by the consumer in their app (not in graphql-upload), and only if necessary. The documentation needs to be updated accordingly, and the examples should probably be updated so people know how to do it. With better documentation we may be able to remove the console warnings from fs-capactitor (in a v4 patch release?).

Mike is taking point on this, and he has been travelling in the last day but we're hoping to make some progress soon.

@gregory
Copy link

gregory commented Dec 3, 2019

Thanks for the update!
Would be nice to either reopen this ticket or update the readme to tell everyone this is only working with node <=10.x :)

@jaydenseric
Copy link
Owner

graphql-upload v9.0.0 has been published, shipping support for Node.js v13 🚀

@lcswillems
Copy link

The version of graphql-upload in Apollo Server has not been upgraded to 9.0.0. I can't use it on Node.JS 13.

Changing the resolutions doesn't work for me.

Any solution?

@gregory
Copy link

gregory commented Dec 6, 2019

The version of graphql-upload in Apollo Server has not been upgraded to 9.0.0. I can't use it on Node.JS 13.

Changing the resolutions doesn't work for me.

Any solution?

You can force it by either using the yarn's resolution or npm-force-resolutions

I added this in my package.json:

  "resolutions": {
    "**/**/fs-capacitor":"^5.0.0",
    "**/graphql-upload": "^9.0.0"
  }

@lcswillems
Copy link

Thank you for your answer! I raged-quit and downgraded to Node 12...

@danieldunderfelt
Copy link

I can confirm that the solution by @gregory works with Apollo Server Express.

@cesargdm
Copy link

cesargdm commented May 24, 2020

Also getting this issue using Node 14.3.0

Solution by @gregory did not work for me, using Apollo Server Express.

@gengjiawen
Copy link

This worked for me when I am on Node.js 14

  "resolutions": {
    "**/**/fs-capacitor":"^6.2.0",
    "**/graphql-upload": "^11.0.0"
  },

@sapkra
Copy link

sapkra commented Jun 11, 2020

I was able to remove the fs-capacitor resolution since v11. But maybe it's not working for everyone.

@olso
Copy link

olso commented Jul 29, 2020

Works for node -v v13.14.0

  "resolutions": {
"apollo-server-koa/apollo-server-core/fs-capacitor": "^6.2.0",
"apollo-server-koa/apollo-server-core/graphql-upload": "^11.0.0"
}

@Oliver-ke
Copy link

This worked for me when I am on Node.js 14

  "resolutions": {
    "**/**/fs-capacitor":"^6.2.0",
    "**/graphql-upload": "^11.0.0"
  },

I'm facing the same issue, how did you get this to work,
I added your solution to package.json
reinstalled packages, and yet it didn't work. currently using node 14.1.0

@anthager
Copy link

I'm facing the same issue, how did you get this to work,
I added your solution to package.json
reinstalled packages, and yet it didn't work. currently using node 14.1.0

Did you add those exact versions to you dependencies as well? I did, added the resolutions in package.json and works for me using node 14.11.0

@eyal-elkevity
Copy link

eyal-elkevity commented Sep 26, 2020

hey @anthager I have the same situation, with Node v14.4, npm installed the specific versions of graphql-upload and fs-capacitor like @Oliver-ke did and it doesn't work... :( did just the dependencies, just the resolutions entry, both together, nada :( :(

btw my project is with stack:

 "dependencies": {
    "apollo-server": "^2.17.0",
    "apollo-server-express": "^2.17.0",
    "express": "^4.17.1",
    "fs-capacitor": "^6.2.0",
    "graphql": "^15.3.0",
    "graphql-upload": "^11.0.0",
    "type-graphql": "^1.0.0",
    "typeorm": "^0.2.26"
  }

and I've implemented the type-graphql solution regarding uploads, and it's working - the exported schema shows the file is an Upload! type in the mutation. so it's just this upload versions thing :(

@eden
Copy link

eden commented Oct 13, 2020

For anyone still hitting this, the resolutions seems to work correctly without globbing. For example:

  "resolutions": {
    "fs-capacitor":"^6.2.0",
    "graphql-upload": "^11.0.0"
  }

Also make sure you include the preinstall script: npx npm-force-resolutions

@sannge
Copy link

sannge commented Oct 21, 2020

For anyone still hitting this, the resolutions seems to work correctly without globbing. For example:

  "resolutions": {
    "fs-capacitor":"^6.2.0",
    "graphql-upload": "^11.0.0"
  }

Also make sure you include the preinstall script: npx npm-force-resolutions

I cannot thank you enough, it suddenly works like a miracle!

@sahanjith
Copy link

For anyone still hitting this, the resolutions seems to work correctly without globbing. For example:

  "resolutions": {
    "fs-capacitor":"^6.2.0",
    "graphql-upload": "^11.0.0"
  }

Also make sure you include the preinstall script: npx npm-force-resolutions

Thank you! This worked for me with Node v14.15.0.

@mohamed-abdelrhman
Copy link

For anyone still hitting this, the resolutions seems to work correctly without globbing. For example:

  "resolutions": {
    "fs-capacitor":"^6.2.0",
    "graphql-upload": "^11.0.0"
  }

Also make sure you include the preinstall script: npx npm-force-resolutions

I can confirm this works for node 14

@forrestwilkins
Copy link

I'm using node 14.13.1 with Next.js and apollo-server-micro. The following resolved the issue:

"resolutions": {
    "fs-capacitor": "^6.2.0"
  }

@melodyLeonard
Copy link

melodyLeonard commented Mar 18, 2021

For anyone still hitting this, the resolutions seems to work correctly without globbing. For example:

  "resolutions": {
    "fs-capacitor":"^6.2.0",
    "graphql-upload": "^11.0.0"
  }

Also make sure you include the preinstall script: npx npm-force-resolutions

I am using yarn package manager and while trying to include this, I get an error that package.lock.json is not found. Do I need to switch to npm or is there a way to do this for yarn

@jaydenseric
Copy link
Owner

@XshubhamX you truly are shameless. Yesterday you agreed not to spam poorly formatted comments asking for help with your work:

#125 (comment)

@evertoncastro
Copy link

Worked for me in node 14.16.1 with the following configuration:

"resolutions": {
    "fs-capacitor": "^6.2.0",
    "graphql-upload": "^11.0.0"
}

I needed to add force-resolutions inside "scripts"

"scripts": {
    ....
    "preinstall": "npx npm-force-resolutions"
}

Remove ./node_modules and install dependencies again.

@varanakonda
Copy link

Worked for me in node 14.16.1 with the following configuration:

"resolutions": {
    "fs-capacitor": "^6.2.0",
    "graphql-upload": "^11.0.0"
}

I needed to add force-resolutions inside "scripts"

"scripts": {
    ....
    "preinstall": "npx npm-force-resolutions"
}

Remove ./node_modules and install dependencies again.

Hi! Thanks! This solution works with yarn, but doesn't work with npm install.
node -v: v14.15.4
npm -v: 6.14.10

@jaydenseric
Copy link
Owner

@ezalivadnyi don’t try to work with the outdated Apollo Server file upload implementation; disable it using uploads: false and install the latest version of graphql-upload from scratch, following the setup instructions in the readme.

https://github.com/jaydenseric/apollo-upload-examples/blob/be1444a0aa8768c6fe2e2c96119eb2b6344fcc50/api/server.js#L78-L81

This won't be a waste of effort because Apollo plans to never update the version of graphql-upload they use in Apollo Server; eventually in Apollo Server v3 they will remove the built in file uploads support in favor of users setting it up themself anyway.

@vincentdesmares
Copy link

I used the solution from Schnitzel and it worked perfectly. See : uselagoon/lagoon#2747

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