Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Byte stream support for FileHandle::readableWebStream #45853

Closed
saschanaz opened this issue Dec 14, 2022 · 1 comment · Fixed by #46933
Closed

Byte stream support for FileHandle::readableWebStream #45853

saschanaz opened this issue Dec 14, 2022 · 1 comment · Fixed by #46933
Labels
feature request Issues that request new features to be added to Node.js. fs Issues and PRs related to the fs subsystem / file system.

Comments

@saschanaz
Copy link

saschanaz commented Dec 14, 2022

What is the problem this feature will solve?

This fails currently:

(await fs.open("./test/animated/87a.gif")).readableWebStream().getReader({mode:'byob'})
Uncaught:
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'stream' must be a byte stream. Received ReadableStream { locked: false, state: 'readable', supportsBYOB: false }
    at __node_internal_captureLargerStackTrace (node:internal/errors:484:5)
    at new NodeError (node:internal/errors:393:5)
    at setupReadableStreamBYOBReader (node:internal/webstreams/readablestream:2127:11)
    at new ReadableStreamBYOBReader (node:internal/webstreams/readablestream:882:5)
    at ReadableStream.getReader (node:internal/webstreams/readablestream:323:12)
    at REPL276:1:96 {
  code: 'ERR_INVALID_ARG_VALUE'
}

But a file is all about bytes and intuitively it should succeed.

What is the feature you are proposing to solve the problem?

Byte stream support for FileHandle::readableWebStream

What alternatives have you considered?

No response

@saschanaz saschanaz added the feature request Issues that request new features to be added to Node.js. label Dec 14, 2022
@saschanaz saschanaz changed the title Byte stream support for readableWebStream Byte stream support for FileHandle::readableWebStream Dec 14, 2022
@aduh95 aduh95 added the fs Issues and PRs related to the fs subsystem / file system. label Dec 18, 2022
@aduh95
Copy link
Contributor

aduh95 commented Dec 18, 2022

/cc @nodejs/fs

debadree25 added a commit to debadree25/node that referenced this issue Mar 3, 2023
nodejs-github-bot pushed a commit that referenced this issue Apr 10, 2023
Fixes: #45853
PR-URL: #46933
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
RafaelGSS pushed a commit that referenced this issue Apr 13, 2023
Fixes: #45853
PR-URL: #46933
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
danielleadams pushed a commit that referenced this issue Jul 6, 2023
Fixes: #45853
PR-URL: #46933
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this issue Jul 6, 2023
Fixes: nodejs#45853
PR-URL: nodejs#46933
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@avivkeller avivkeller moved this from Awaiting Triage to Done in Node.js feature requests Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants