Passing Blob object to component propertyies

Hello everyone,

When passing Blob to a component property, I’m getting this error:
Invalid prop: type check failed for prop "someBlob". Expected Object, got Blob

If I define it as Blob in components props, I get the error that Blob is undefined.

The workaround way is converting Blob to base64, then converting it back to Blob. Suppose I could pass it as it could be much easier with less code. Isn’t it possible with Vue?

no problem image

Thank you @zc1789284658 , but It didn’t work(

Syntax Error: Unexpected token, expected "," (8:30) friendly-errors 13:54:10

I use Vue2 without typescript, maybe it’s the reason why this code didn’t work?

props:{audio:{type:Blob}} is not work?

Nope, this error appears :cry:

image

Strange. A basic test setup shows it should actually work both ways, with {audio: Blob} as well as {audio: {type: Blob}}

How does your setup differ from this example?

@abernh thank you for assistance.

Seems like problem is somewhere at NuxtJS configuration

Well, with Nuxt in the mix this is a different question.
Blobs are a browser API thing and not available in Node. So when you compile your Nuxt app it will not find anything like a Blob.

And here we can switch over to Stackoverflow, where somebody already went into detail on how to fix similar issues with Node + Blob

1 Like