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().arrayBuffer() returns an ArrayBuffer of wrong size #12190

Closed
gyf304 opened this issue Jun 27, 2024 · 3 comments
Closed

Bun.file().slice().arrayBuffer() returns an ArrayBuffer of wrong size #12190

gyf304 opened this issue Jun 27, 2024 · 3 comments
Labels
bug Something isn't working needs triage

Comments

@gyf304
Copy link

gyf304 commented Jun 27, 2024

What version of Bun is running?

1.1.17

What platform is your computer?

Darwin 23.1.0 arm64 arm

What steps can reproduce the bug?

const arrayBuffer = new ArrayBuffer(1000);
const blob = new Blob([arrayBuffer]);

await Bun.write("test.bin", arrayBuffer);
const file = Bun.file("test.bin");

const blobSlice = await blob.slice(0, 100).arrayBuffer();
const fileSlice = await file.slice(0, 100).arrayBuffer();

console.log(blobSlice.byteLength, fileSlice.byteLength);
// expected: 100 100
// actual: 100 1000

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@gyf304 gyf304 added bug Something isn't working needs triage labels Jun 27, 2024
@gyf304 gyf304 changed the title Bun.file().slice().arrayBuffer() returns an arrayBuffer of wrong size Bun.file().slice().arrayBuffer() returns an ArrayBuffer of wrong size Jun 27, 2024
@gyf304
Copy link
Author

gyf304 commented Jun 27, 2024

related: #616 #8215

@Electroid
Copy link
Contributor

Thanks for reporting this! This is likely a duplicate of #8215, so we'll track the work there.

@Electroid
Copy link
Contributor

Duplicate of #8215

@Electroid Electroid marked this as a duplicate of #8215 Jun 27, 2024
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants