Kitware / itk-vtk-viewer

2D / 3D web image, mesh, and point set viewer using itk-wasm and vtk.js
https://kitware.github.io/itk-vtk-viewer/
BSD 3-Clause "New" or "Revised" License
210 stars 64 forks source link

Embedding the ITK-VTK-Viewer doesn't work #686

Closed EricMoerthVis closed 1 year ago

EricMoerthVis commented 1 year ago

Embedding the itk-vtk-viewer doesn't work doe to web worker not being found:

kVtkViewer.js:2 GET http://localhost:3000/src/itk/web-workers/min-bundles/pipeline.worker.js 404 (Not Found) (anonymous) @ itkVtkViewer.js:2 e2.exports @ itkVtkViewer.js:2 e2.exports @ itkVtkViewer.js:2 u.request @ itkVtkViewer.js:2 u. @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 y @ itkVtkViewer.js:2 H @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 u @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 K @ itkVtkViewer.js:2 a4 @ itkVtkViewer.js:2 Promise.then (async) K @ itkVtkViewer.js:2 a4 @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 nj @ itkVtkViewer.js:2 rj @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:169 u @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 K @ itkVtkViewer.js:2 a4 @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:169 (anonymous) @ itkVtkViewer.js:169 (anonymous) @ itkVtkViewer.js:2 hG @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 add @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:169 (anonymous) @ ITKVTKSubscriber.js:41 Promise.then (async) (anonymous) @ ITKVTKSubscriber.js:36 Promise.then (async) (anonymous) @ ITKVTKSubscriber.js:26 commitHookEffectListMount @ react-dom.development.js:23150 commitPassiveMountOnFiber @ react-dom.development.js:24926 commitPassiveMountEffects_complete @ react-dom.development.js:24891 commitPassiveMountEffects_begin @ react-dom.development.js:24878 commitPassiveMountEffects @ react-dom.development.js:24866 flushPassiveEffectsImpl @ react-dom.development.js:27039 flushPassiveEffects @ react-dom.development.js:26984 performSyncWorkOnRoot @ react-dom.development.js:26076 flushSyncCallbacks @ react-dom.development.js:12042 commitRootImpl @ react-dom.development.js:26959 commitRoot @ react-dom.development.js:26682 finishConcurrentRender @ react-dom.development.js:25981 performConcurrentWorkOnRoot @ react-dom.development.js:25809 workLoop @ scheduler.development.js:266 flushWork @ scheduler.development.js:239 performWorkUntilDeadline @ scheduler.development.js:533 itkVtkViewer.js:2 Uncaught (in promise) Error: Request failed with status code 404 at e2.exports (itkVtkViewer.js:2:75619) at e2.exports (itkVtkViewer.js:2:78035) at XMLHttpRequest.x (itkVtkViewer.js:2:70253) e

PaulHax commented 1 year ago

@EricMoerthVis PR #679 fix the viewer for your case?

EricMoerthVis commented 1 year ago

I was waiting for the pull request to be merged. I can try it out before this happens as well

EricMoerthVis commented 1 year ago

Just tried, I unfortunately still get the same error: XHR GET http://localhost:3000/src/itk/web-workers/min-bundles/pipeline.worker.js [HTTP/1.1 404 Not Found 4071ms]

PaulHax commented 1 year ago

There are some lazily loaded runtime assets (pipeline.worker.js, *.wasm) that need to be next to itkVtkViewer.js. Try copying the whole dist folder into your public directory.

EricMoerthVis commented 1 year ago

I will try that and let you know if it works

EricMoerthVis commented 1 year ago

yes it works now! Thank you very much!