Donaldcwl / browser-image-compression

Image compression in web browser
MIT License
1.31k stars 161 forks source link

Cannot find module 'browser-image-compression'. #42

Closed FangerZero closed 4 years ago

FangerZero commented 4 years ago

I was trying to use this, but after installing I can't seem to import the module? I don't really understand how to even do what people are saying because they just say thing's like create a d.ts file and declare it there. What does that even mean?

I've had to import it like this import imageCompression from "../../../../node_modules/browser-image-compression/dist/browser-image-compression";

Donaldcwl commented 4 years ago

You should import like this: import imageCompression from 'browser-image-compression';

Please a look at a working React example here: https://github.com/Donaldcwl/browser-image-compression/tree/master/example/React%20App