Skip to content

Broken compatibility with Node.js 16.0 #5

Closed
NeuraLegion/multer
#23
@pubmikeb

Description

@pubmikeb

fs‑temp passes null as the path parameter:

WriteStream.call(this, null, options)
which breaks the compatibility with Node.js 16.0 and leads to the crash when using fs‑temp:

node:internal/process/promises:245
          triggerUncaughtException(err, true /* fromPromise */);
          ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received null
    at TempWriteStream.WriteStream (node:internal/fs/streams:360:5)
    at new TempWriteStream (C:\Users\User\IdeaProjects\TMS\node_modules\fs-temp\lib\write-stream.js:6:15)
    at Object.createWriteStream (C:\Users\User\IdeaProjects\TMS\node_modules\fs-temp\lib\temp.js:121:10)
    at Busboy.<anonymous> (C:\Users\User\IdeaProjects\TMS\node_modules\multer\lib\read-body.js:70:27)
    at Busboy.emit (node:events:369:20)
    at Busboy.emit (C:\Users\User\IdeaProjects\TMS\node_modules\busboy\lib\main.js:37:33)
    at PartStream.<anonymous> (C:\Users\User\IdeaProjects\TMS\node_modules\busboy\lib\types\multipart.js:214:13)
    at PartStream.emit (node:events:369:20)
    at HeaderParser.<anonymous> (C:\Users\User\IdeaProjects\TMS\node_modules\dicer\lib\Dicer.js:50:16)
    at HeaderParser.emit (node:events:369:20) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Process finished with exit code 1

At Node.js thread I've got a response that the change nodejs/node#35187 has broken some compatibility and fs-temp has to be adjusted to be able to work with Node.js 16.0+

Update:
Node.js 16.0 has been officially released and neither fs‑temp, nor any depending on it module don't support Node.js 16.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions