cornerstoneWADOImageLoader icon indicating copy to clipboard operation
cornerstoneWADOImageLoader copied to clipboard

Failed to execute 'importScripts' on 'WorkerGlobalScope'

Open LexaDel opened this issue 4 years ago • 10 comments

I try load dcm through wado-image-loader and got the error DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope' An example I pressed libjpeg-turbo 12-bit and there is the same error in the browser's console on example

LexaDel avatar Oct 10 '21 12:10 LexaDel

Duplicate of #401

LexaDel avatar Oct 10 '21 12:10 LexaDel

@swederik Could you help me?

LexaDel avatar Oct 12 '21 08:10 LexaDel

It is very weird that it's not able to find the bundle. We did actually stop using the WASM version of libjpeg-turbo compiled for 12 bits though because it doesn't quite work yet.

We are still using jpeg.js for 12 bit here: https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/master/src/shared/decoders/decodeJPEGBaseline12Bit-js.js#L9

As far as I know all the tests are passing but you are right, it also seems to be failing here: https://cornerstone-wado-image-loader.netlify.app/wadouri/index.html

Thanks for the report!

swederik avatar Oct 12 '21 08:10 swederik

@swederik I noticed, the same problem with both JPEG Lossless here: https://cornerstone-wado-image-loader.netlify.app/wadouri/index.html

LexaDel avatar Oct 14 '21 09:10 LexaDel

Anything new on this issue?

I found one Dicom file out of 7 that the loader actually succeeded in loading. @swederik

JonathanGilyadov avatar Nov 24 '21 14:11 JonathanGilyadov

I fixed this issue using this workaround in the webWorkerManager config:

webWorkerTaskPaths: [
    "https://unpkg.com/[email protected]/dist/610.bundle.min.worker.js",
    "https://unpkg.com/[email protected]/dist/888.bundle.min.worker.js"
  ]

daron1337 avatar Dec 02 '21 11:12 daron1337

Error: webWorkerTaskPaths: [ "/js/610.bundle.min.worker.js", "/js/888.bundle.min.worker.js" ] Success: webWorkerTaskPaths: [ "http://ip:port/js/610.bundle.min.worker.js", "http://ip:port/js/888.bundle.min.worker.js" ]

From China Coder~

jayhuang666 avatar Apr 13 '22 08:04 jayhuang666

I met this issue with using version 4.1.x, and fixed with rollback version to 3.3.2.

zzoman avatar May 04 '22 09:05 zzoman

I am facing the same issue. I am using embedded viewer in react. Below is how i tried using the webWorkerTaskPaths. Unable to get this to work any help will be greatly appreciated. const ohifViewerConfig = { // default: '/' routerBasename: routerBaseUri, showStudyList: false, filterQueryParam: false, webWorkerTaskPaths: [ "/static/js/610.bundle.min.worker.js", "/static/js/888.bundle.min.worker.js" ]

pankajmisr avatar Oct 02 '22 16:10 pankajmisr

Solution:

folder = MySiteURL+'/dcmviewer/js'; config = { maxWebWorkers: navigator.hardwareConcurrency || 1, startWebWorkersOnDemand : true, webWorkerTaskPaths: [ folder + "/610.bundle.min.worker.js", folder + "/888.bundle.min.worker.js" ], // webWorkerTaskPaths: [ // "https://unpkg.com/[email protected]/dist/610.bundle.min.worker.js", // "https://unpkg.com/[email protected]/dist/888.bundle.min.worker.js" // ], taskConfiguration: { 'decodeTask' : { initializeCodecsOnStartup: false, usePDFJS: false } } }; cornerstoneWADOImageLoader.webWorkerManager.initialize(config);

pascualdas avatar Feb 21 '24 15:02 pascualdas