Could not find a declaration file for module 'image-blob-reduce'
See original GitHub issueI get this error when trying to use the module. Here’s my code:
const reduce = require('image-blob-reduce');
export async function reduceBlob(originalBlob) {
await reduce
.toBlob(originalBlob, { max: 300 })
.then(blob => {
console.log(blob);
return blob;
});
}
Not sure how to solve this issue 😛
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module 'module-name ...
Here are two other solutions. When a module is not yours - try to install types from @types : npm install -D @types/module-name....
Read more >Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve the...
Read more >How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
Read more >[TypeScript] Could not find a declaration file for module 'node ...
When using apollo-env through apollo-server, I get the following error during TypeScript builds: ...
Read more >Could not find a declaration file for module 'mongodb ... - Reddit
I'm using NextJS and Typescript, with mongodb version 3.7.3 If you go here: https://www.npmjs.com/package/@types/mongodb it states mongodb ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I made a bit more sophisticated module.
At first install
npm install --save @types/pica
to get types for reduce options.Then add
image-blob-reduce.d.ts
to your project with such content:If you need other methods except
toBlob()
add them toImageBlobReduce
interface.Then use it in your typescript files like this:
Hey @puzrin, If it seems ok to you I can try to add @types for this library. Have never done it before, but it shouldn’t be very difficult.
@melnikovdv
If that does not depends on me, you don’t need my opinion 😃. I don’t use TS, do as you wish/need.