Getting Module not found error

I am trying to add the code from this demo into my project. However, it is failing to find the two imported modules.

Errors:

  • Module not found: Error: Can't resolve 'vtk.js/Interaction/Manipulators' in '/.../.../itk-vtk-viewer/src/vtk'
  • Module not found: Error: Can't resolve 'vtk.js/Interaction/Style/InteractorStyleManipulator' in '/.../.../itk-vtk-viewer/src/vtk'

My code already has multiple imports and I am just adding the other two (see last two lines of snippet below)

...
import vtkPolyData from 'vtk.js/Sources/Common/DataModel/PolyData'
import vtkBoundingBox from 'vtk.js/Sources/Common/DataModel/BoundingBox'
import vtkAxesLabelsWidget from './AxesLabelsWidget'
import vtkWidgetManager from 'vtk.js/Sources/Widgets/Core/WidgetManager'

import vtkInteractorStyleManipulator from 'vtk.js/Interaction/Style/InteractorStyleManipulator';
import Manipulators from 'vtk.js/Interaction/Manipulators';

I have tried running npm install vtk.js to update the modules and after that did not work, I also deleted the node_modules folder and ran npm install to regenerate. Neither worked.

Am I missing something?


Just in case it is important. I am actually making changes to itk-vtk-viewer code (snippet above) and building those changes through itkwidgets module, i.e. I am running npm run build on .../itkwidgets/js/ folder.

I have ran npm install vtk.js in both the itk-vtk-viewer folder and also the itkwidgets/js folder.

The modules are within the Sources folder. Must have been updated at some stage?

import vtkInteractorStyleManipulator from 'vtk.js/Sources/Interaction/Style/InteractorStyleManipulator';
import Manipulators from 'vtk.js/Sources/Interaction/Manipulators';

However, now there is no vtkMouseBoxSelectorManipulator within Manipulators.

In dependancies of the package.json file, the version of vtk.js is 14.11.4


Only seems to have been added in more recent versions