-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Blob type set to empty string causing InvalidStateError #25971
Comments
I think you should use your own file server that respond |
Thank you, that helped me get a little further! The type is now set correctly to image/jpeg, however it looks like jpegs simply aren't supported at the moment? (Though for now I should be able to get away with converting to pngs) Additionally, when I try to use PNGs instead of JPEGs I run into the following problem so my PNGs need to fulfil certain requirements as well?
|
The enhancement of |
We do not set |
Version:
deno 2.0.0-rc.9 (release candidate, release, aarch64-apple-darwin)
v8 12.9.202.13-rusty
typescript 5.6.2
Hi there,
I'm trying to use the
fetch
API to grab a locally saved file. I'm usingloadImageBitmap
with an absolute path to a JPG file passed in as the url, prefixed withfile:///
. I can see that the thefetch
has succeeded, however the resulting blob fromconst blob = await res.blob()
looks likeBlob { size: 695303, type: "" }
and the empty string value oftype
is causing the following error:I'm stumped on how to get around this, any tips or suggestions on what I'm doing wrong much appreciated
, but also it looks like to me that thetype
is probably erroneously being set to''
based on the documentation for ResponseType.Edit: I've realised I was looking at the documentation for
Response
and not forBlob
.Blob::type
is typed as just a string so it can very validly be set to empty string.Edit2: Looks like when
fetch
resolves to reading a blob out of the filesystem, the content-type of the response is not set. And then the mimetype becomesnull
/''
.Thanks so much for reading!
The text was updated successfully, but these errors were encountered: