Hey Guys,
So I’m building a simple plugin that is an action only. It will use the Image URL of an image uploaded through Bubble’s Picture uploader, which is currently for testing is beside a random text element I am using to start an Element Onclick Workflow action. This is where the plugin comes in as it ONLY an action.
Everything works fine except when an svg image is uploaded. When this happens I get a CORS error but never for any other image type. Can anyone point out a solution here? I have looked through a lot of forum posts and no solutions have worked for me.
There is a single field associated with the action which is image. This is set to the images URL that the bubble image type gives. This code fails on the fetch() when the image is an svg but not the other image types.
function(properties, context) {
let response = context.async(async cb => {
fetch(properties.image)
.then((r) => { cb(null, r); }).catch((e) => { cb(e); });
});
let blob = context.async(async cb => {
response.blob()
.then((r) => { cb(null, r); }).catch((e) => { cb(e); });
});
console.log("blob type - " + blob.type);
}