the import statement in PiecewiseGaussianWidget.js file bellow occurs error when compiled in react project.
import { W as WorkerFactory } from '../../_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js';
who can tell me how to deal with the error.
Compiled with problems:X
ERROR in ./node_modules/@kitware/vtk.js/Interaction/Widgets/PiecewiseGaussianWidget.js 546:23-36
export ‘W’ (imported as ‘WorkerFactory’) was not found in ‘…/…/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js’ (possible exports: default)
I would recommend upgrading if that is possible for you, since we are on v25 now. If upgrading is not possible, I can investigate to see if that version has a faulty export.
Hm, it could be that create-react-app is auto-transforming *.worker.js, but I don’t imagine why they would be doing that for node_modules. Do you have a minimal proof of concept repo that reproduces this problem?
Ah, the rules you have in config-overrides.js is unnecessary. You don’t need the worker-loader, since that worker file is already transpiled in the @kitware/vtk.js package.