-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: Missing export default
in ComputeHistogram.worker.js
#1737
Comments
Workers are expected to be handled by a dedicated loader. |
Isn't the warning still valid? There is no It is used here: import ComputeHistogramWorker from './ComputeHistogram.worker';
const worker = new ComputeHistogramWorker();
const workerPromise = new WebworkerPromise(worker); |
No, I would not think so. |
I see, although the warning is generated from current code from visualizer. I thought it belonged here. |
That is an issue on how visualizer is setup (loader config). Probably when Visualizer started to use the vtk.js class, that class was not using any worker and therefore everything was fine. But when we updated vtk.js inside Visualizer a while back we broke it by not adding the proper loaders to handle the workers properly. This should be fixed but I guess no one get to it ;-) |
Thanks @jourdain. Give me a couple of months and I might get up to speed with javascript and a small niche of its rapid-changing ecosystem to start fixing my own findings! Meanwhile, I just report issues as I find them :) Closing, as it belongs to kitware/visualizer. |
Hi Jourdain, may I know what do you mean by a dedicated loader? cause I got the following error when trying to use itkwidgets(which used itk-vtk-viewer, which used vtk.js).
And I checked the vtk.js/Utilities/config/dependency.js has the loader for worker.js, is there any step required to set it up correctly?
|
Linking your itkwidgets issue for cross-referencing purposes: InsightSoftwareConsortium/itkwidgets#668 This is a project build process issue, where the project using vtk.js doesn't properly ingest vtk.js source files. I don't think this is a vtk.js issue, but rather a downstream project issue. |
Thanks floryst, is there any guide on how I can make the downstream project configure right? I checked the intro_vtk_as_es6_dependency and old_intro_vtk_es6, and I checked the webpack.config.js, which has the vtkRules configured and has the loader for worker.js, https://github.com/Kitware/itk-vtk-viewer/blob/master/webpack.config.js#L56-L69. So is there anything else I should check to? |
Imported here:
https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js#L6
import ComputeHistogramWorker from './ComputeHistogram.worker';
But there is no export default in ComputeHistogram.worker.js
The other worker: https://github.com/Kitware/vtk-js/blob/master/Sources/Filters/General/PaintFilter/PaintFilter.worker.js might suffer the same warning, but haven't tested.
The text was updated successfully, but these errors were encountered: