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

[@uplo/service-gcs] Uint8Array not implemented but looks supported ? #13

Open
iRyusa opened this issue Nov 9, 2023 · 2 comments
Open

Comments

@iRyusa
Copy link

iRyusa commented Nov 9, 2023

Hi !

I don't know if i'm doing something wrong but in Bun I do :

await uplo.attachments.user(user.id).avatar.attachFile({
            fileName: file.name,
            content: Buffer.from(await file.arrayBuffer()),
            contentType: file.type
          })

The problem is:
Buffer.from(await file.arrayBuffer()) instanceof Uint8Array returns true

So it throws because of this:

} else if (content instanceof Uint8Array) {
  throw new Error("Uint8Array not implemented");
}

If I comment it, the file is uploaded properly tho, is there any reason you can't send a Buffer to GCS ?

@jpalumickas
Copy link
Owner

Hey!

Good question, last time I checked, GCS was not supported Unit8Array, but yea, we can try to impement this or just remove this line.

@iRyusa
Copy link
Author

iRyusa commented Nov 10, 2023

Do you want a PR for this ? I'm trying to avoid fork+publish it possible 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants