Donaldcwl / browser-image-compression

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

can not work on Ie 11 #67

Closed deathelegy closed 4 years ago

artisanbhu commented 4 years ago

I am not sure is this because, web worker option is enabled by default. useWebWorker: boolean, // optional, use multi-thread web worker, fallback to run in main-thread (default: true)

If it disabled by setting useWebWorker to false, it works fine. If it is enabled i am seeing this error in console, and compress promise never resolves. Console error : SCRIPT0: Script Error Line: 0

The documentation https://www.npmjs.com/package/browser-image-compression says webworker is supported in IE, but it is not working.

Note : Promise polyfill is loaded in my codebase, https://github.com/taylorhakes/promise-polyfill

@Donaldcwl please help !!

Donaldcwl commented 4 years ago

Promise API is being used in this library. If you need to support browsers that do not support Promise like IE. You can include the Promise polyfill in your project.

see how: https://github.com/Donaldcwl/browser-image-compression/blob/9fcc363eeec63c7ff044144cf98d5bb3a408201a/README.md#ie-support