-
Notifications
You must be signed in to change notification settings - Fork 127
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 method does not exist in the result #38
Comments
Hi @frbuceta. |
|
Indeed because
BTW do you mind sharing |
If I use fetch, the blob is empty. You can see it in the codesandbox that you paste above. |
The issue is beyond ohmyfetch then😅 We also need to support I would appreciate it if you can move the issue to nuxt/framework to track support. |
BTW regarding example, for images you can directly reference them as https://codesandbox.io/s/fetch-blob-error-forked-mh1fm?file=/app.vue |
I am going to create a new issue there that makes a link to the two issues |
I need it to be in blob to send it to another service. It is not to render the image in html |
@frbuceta Apart from Blob support in <template>
<pre>
{{ banners }}
</pre>
</template>
<script setup>
import _ from "lodash";
// eslint-disable-next-line
const { data: banners, refresh: bannersFetcher } = await useAsyncData(
"banners",
async () => {
const banners = await $fetch("/api/banners").then((data) => {
return Promise.all(
_.map(data, async (banner) => {
// const blob = await $fetch.raw(banner.data).then((res) => res.blob());
const blob = await fetch(banner.data).then((r) => r.blob());
console.log(blob);
+ return blob;
})
);
});
console.log(banners);
+ return banners;
}
);
</script> |
I try to pass the Blob to File but it doesn't work either. const { data: banners, refresh: bannersFetcher } = await useAsyncData(
"banners",
async () => {
const banners = await $fetch("/api/banners").then((data) => {
return Promise.all(
_.map(data, async (banner) => {
// const blob = await $fetch.raw(banner.data).then((res) => res.blob());
const blob = await fetch(banner.data).then((r) => r.blob());
console.log(blob);
return { ...banner, file: new File([blob], banner.name) };
})
);
});
console.log(banners);
return banners;
}
); |
|
How can I return the result in blob? It seems that .blob() does not exist
The text was updated successfully, but these errors were encountered: