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

Support Node.js v14 #209

Closed jaydenseric closed 4 years ago

jaydenseric commented 4 years ago

At the moment, the graphql-upload tests are failing for Node.js v14:

https://github.com/jaydenseric/graphql-upload/runs/701487224?check_suite_focus=true#step:4:82

The error is:

_stream_readable.js:636
  throw new ERR_METHOD_NOT_IMPLEMENTED('_read()');
  ^

Error [ERR_METHOD_NOT_IMPLEMENTED]: The _read() method is not implemented
    at Readable._read (_stream_readable.js:636:9)
    at Readable.read (_stream_readable.js:475:10)
    at resume_ (_stream_readable.js:962:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'ERR_METHOD_NOT_IMPLEMENTED'
}

Is it because of this in fs-capacitor?:

https://github.com/mike-marcacci/fs-capacitor/blob/45ab8cb354a90914ce87c0069273ff40ff20654e/src/index.ts#L28

See https://github.com/mike-marcacci/fs-capacitor/issues/28 .

Does it relate to this Node.js v14 change?:

https://github.com/nodejs/node/pull/31912

Here are the Node.js v14 release notes:

https://nodejs.org/en/blog/release/v14.0.0/

jaydenseric commented 4 years ago

fs-capacitor currently has TypeScript related build errors, but when checking it out locally it seems the actual tests are passing in Node.js v14. Either those tests are missing something, or the problem is not with fs-capacitor.

jaydenseric commented 4 years ago

Ok, the problem relates to the ignoreStream function:

https://github.com/jaydenseric/graphql-upload/blob/v10.0.0/lib/ignoreStream.js#L10

The issue surfaces in these tests:

https://github.com/jaydenseric/graphql-upload/blob/v10.0.0/test/lib/ignoreStream.test.js

jaydenseric commented 4 years ago

Turned out to only be an issue with the tests; the published code was ok.