Web Worker Failing on Chrome
See original GitHub issueChrome 75.0.3770.100 Win 10 64-bit
I do the following:
var compressionOptions = {
maxSizeMB: 0.8,
maxWidthOrHeight: 1920,
useWebWorker: true,
exifOrientation: true
};
const imageFile = await imageCompression(
file,
compressionOptions
);
and get the following in browser console:
browser-image-compression.mjs:430 Run compression in web worker failed: x is not defined , fall back to main thread
Any ideas what could be wrong? The image is correctly compressed, but without a web worker.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Why does not Chrome allow Web Workers to be run in ...
The answer on Chrome can't load web worker says Chrome doesn't let you load web workers when running scripts from a local file....
Read more >web workers on Chrome don't work locally - Google Groups
Hi Everyone, I've come across an issue that I am unsure is a problem with Chrome or my setup. Linked from the W3...
Read more >443374 - Web Worker network requests blocked by main ...
Issue 443374: Web Worker network requests blocked by main thread in Chrome · 1. Estimate performance gain. · 2. Have some doc/plan about...
Read more >Understanding and Using Web Workers - CODE Magazine
Instead, you have to open a new browser tab and navigate to chrome://inspect. The Dev Tools list on the left shows Shared Workers....
Read more >Web worker fails to load in sandboxed iframe with Firefox 45
We see this behavior when using pdf.js to display PDF's inside a sandboxed iframe. Actual results: PDF.js fails to load the web worker...
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 FreeTop 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
Top GitHub Comments
@Donaldcwl i m having an issue when my browser adblock on chrome is turned ON , i get this error in console.
Refused to create a worker from ‘blob:https://site.com/3e9ce499-7750-4d8c-896b-7db16d4677c6’ because it violates the following Content Security Policy directive: “script-src ‘self’ * ‘unsafe-inline’”. Note that ‘worker-src’ was not explicitly set, so ‘script-src’ is used as a fallback.
(anonymous) @ browser.img.compress.js:1 (anonymous) @ browser.img.compress.js:1 (anonymous) @ browser.img.compress.js:1 (anonymous) @ browser.img.compress.js:1 browser.img.compress.js:1 Uncaught DOMException: Failed to construct ‘Worker’: Access to the script at ‘blob:https://site.com/3e9ce499-7750-4d8c-896b-7db16d4677c6’ is denied by the document’s Content Security Policy. at https://site.com/js/browser.img.compress.js:1:7705 at https://site.com/js/browser.img.compress.js:1:7770 at https://site.com/js/browser.img.compress.js:1:165 at https://site.com/js/browser.img.compress.js:1:169
Any way to fix this, i have even turned off use web worker option by false.
There should be no problem in v1.0.7