createReadStream() throwing RangeError: Maximum call stack size exceeded when uploading file

Turns out it was this bug in graphql-upload. Downgraded to node 12 and it's fixed (solution listed there did not help me)


Add this to package.json:

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

source: https://github.com/jaydenseric/graphql-upload/issues/170#issuecomment-641938198


This error occured to me in node version 14 too! I solved it as follows:

  1. Install latest version of graphql-upload !

  2. use graphqlUploadExpress middleware to define the maximum file limit.

    import { graphqlUploadExpress } from "graphql-upload";
    const app = express()
    app.use(graphqlUploadExpress({ maxFileSize: 1000000000, maxFiles: 10 }));
    
  3. Set uploads to false while initializing the ApolloServer

      const server = new ApolloServer({
        uploads: false,
        schema,
      });