NPM Worker not found

216 Views Asked by At

I try to duplicate an existing library from npm (final goal is to edit an algorithm). The original library used is vtk.js. The only component I will try to duplicate localy is the PaintFilter worker.

So I duplicate the PaintFilter.js in my own structure and it's working fine as it use the original worker from vtk.js.

No problem with this

import PaintFilterWorker from 'vtk.js/Sources/Filters/General/PaintFilter/PaintFilter.worker';

But once I try to use my own worker (currently a copy pasted of the original, located in the same directory as my local PaintFilter) with this command

import PaintFilterWorker from './PaintFilter.worker';

I have an error

WARNING in ./resources/assets/js/PaintFilter/PaintFilter.js
28:19-36 "export 'default' (imported as 'PaintFilterWorker') was not found in './PaintFilter.worker'.

As I use the exact same code as the original one I don't understand why it's not working.

I tried to rename it but still have the same issue. I'm starting with npm and js module so maybe I missed something. Sorry if this is the case.

0

There are 0 best solutions below