-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Closed
Copy link
Description
- Version: v14.4.0
- Platform: Linux arch 5.7.2-arch1-1
- Subsystem: fs.promises FileHandle
What steps will reproduce the bug?
Using FileHandle.read() with object argument.
This example throws TypeError
:
const fs_p = require('fs').promises;
fs_p.open('exampleFile.txt', 'r')
.then((fileHandler) => {
const header_buffer = Buffer.alloc(10);
fileHandler.read({ buffer: header_buffer, offset: 12 })
.then(({ bytesRead, buffer }) => {
console.log("Reading")
}).catch((err) => {
throw err;
});
}).catch((err) => {
throw err;
});
How often does it reproduce? Is there a required condition?
Everytime you use object as argument.
What is the expected behavior?
Method should accept object as parameter, as stated in docs here.
What do you see instead?
TypeError [ERR_INVALID_ARG_TYPE]: The "buffer" argument must be an instance of Buffer, TypedArray, or DataView. Received an instance of Object
Additional information
This bug dosen't seem too complicated, maybe I could fix it.
Metadata
Metadata
Assignees
Labels
No labels