can not find name 'blobUtil'
binita12345 opened this issue · 3 comments
binita12345 commented
when i use this node modules to convert my image in blob, i getting error "can not find module 'blobUtil'".
- I have installed "npm i blob-util" module
- import { canvasToBlob } from 'blob-util' , when i use to convert in blob in my app.
- my code is:
blobUtil.imgSrcToBlob(res.json().data.productImage).then(function (blob) {
// success
}).catch(function (err) {
// error
});
How to solve this error or how to install or use modules in ionic 3 app.
please reply asap
nolanlawson commented
When you import using the ESM module format:
import { canvasToBlob } from 'blob-util'
Then you omit the blobUtil
part when you call it. It's only when you include it as a script tag that it creates a global blobUtil
object. Hope that helps!
binita12345 commented
Property 'imgSrcToDataURL' does not exist on type '{}'.
nolanlawson commented
It sounds like the library wasn't imported properly. Sorry I can't help you more than that...