Closed JeffBeltran closed 1 month ago
Since version v19.1.0 streams (instead of buffering all the data) the Blob provided via fileTypeFromBlob(blob).
Please note associated documentation:
It will stream the underlying Blob, and required a ReadableStreamBYOBReader which require Node.js ≥ 20.
Updated the release notes to warn for this change v19.1.0. A major change would have reflected these API this changes better.
yeah a major change (as this is breaking) would have been nice, but really not a big deal, thanks for pointing this out. A quick look, appears that ReadableStreamBYOBReader
might not be supported in Bun but i can just swap out the blob for buffer for my simple use case.
const buffer = await imageResponse.arrayBuffer();
const fileType = await fileTypeFromBuffer(Buffer.from(buffer));
const fileName = changeCase.kebabCase(title)
Just upgraded to 19.1.0 from 19.0.0 and ran into an error. Rolling back to 19.0.0 fixes it, but thought I'd let you know.
Here's the error I'm seeing:
I'm using Bun (1.1.18) for a simple script. Here's the relevant code:
I can provide more details or a reproduction if needed, but figured I'd drop this here first in case it's an easy fix. Let me know if you need anything else!