jaydenseric / graphql-upload

Middleware and a scalar Upload to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
https://npm.im/graphql-upload
MIT License
1.43k stars 132 forks source link

Node v14 "Maximum call stack exceeded" #221

Closed byeze closed 4 years ago

byeze commented 4 years ago

Hi! I'm currently having the following problem when uploading a file:

RangeError: Maximum call stack size exceeded
    at ReadStream.deprecated [as open] (internal/util.js:89:15)

Code that I'm using:

addProduct: async (_parent, { data, photo }, ctx) => {
        return await needsRole(ctx)
            .then(async () => {
                return photo.then(async (file) => {
                    const { createReadStream, filename } = file;
                    const fileStream = createReadStream();

                    ...

npm ls graphql-upload output:

+-- apollo-server@2.16.1
| `-- apollo-server-core@2.16.1
|   `-- graphql-upload@8.1.0
`-- apollo-server-express@2.18.2
  `-- apollo-server-core@2.18.2
    `-- graphql-upload@8.1.0  deduped

Node version: v14.13.0

jaydenseric commented 4 years ago

The current graphql-upload version is v11.0.0; you need to upgrade from the outdated dependency Apollo is using which is not Node.j v14 compatible. Please direct any problems about Apollo using outdated dependencies to their issue tracker - there are a lot of existing conversations.

byeze commented 4 years ago

Thank you!