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

Bun.file().slice(1).stream() returns entire original file, not slice #8718

Closed
anderspitman opened this issue Feb 6, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@anderspitman
Copy link

What version of Bun is running?

1.0.26+c75e768a6

What platform is your computer?

Linux 6.7.2-arch1-1 x86_64 unknown

What steps can reproduce the bug?

file.txt

Hi there

bunfile.js

const file = Bun.file("./file.txt");
const slice = file.slice(1);

console.log(await slice.text());

const decoder = new TextDecoder('utf-8');
for await (const chunk of slice.stream()) {
  console.log(decoder.decode(chunk));
}

What is the expected behavior?

I would expect both of them to be offset.

What do you see instead?

Running bun bunfile.js prints:

i there

Hi there

Additional information

No response

@anderspitman anderspitman added the bug Something isn't working label Feb 6, 2024
@bogeychan
Copy link

Duplicate of #7057

@Electroid
Copy link
Contributor

Duplicate of #7057

@Electroid Electroid marked this as a duplicate of #7057 Feb 6, 2024
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
@anderspitman
Copy link
Author

Sorry, didn't see the dup. I searched for "file stream" but didn't see anything obvious in the current issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants