Kitware / glance

Kitware Glance is an open-source web application developed at Kitware for visualizing volumetric images, molecular structures, geometric objects, and point clouds. It is part of the ParaView platform and can serve as a foundation for building custom web-based visualization applications involving ITK.js and VTK.js.
https://kitware.github.io/glance
BSD 3-Clause "New" or "Revised" License
247 stars 87 forks source link

"npm link vtk.js" causes compile failures #286

Open psavery opened 4 years ago

psavery commented 4 years ago

For some reason, it looks like webpack is having some big issues compiling paraview glance if there is a soft link to a local vtk.js. You end up getting compile errors such as:

Error resolving webpackConfig Error: Cannot find module '/home/patrick/src/vtk-js/build/webpack.dev.config.js'`

And lots of module not found errors such as:

ERROR in ../vtk-js/Sources/Proxy/Representations/GlyphRepresentationProxy/index.js
Module not found: Error: Can't resolve 'vtk.js/Sources/vtk' in '/home/patrick/src/vtk-js/Sources/Proxy/Representations/GlyphRepresentationProxy'

Strangely enough, if you recursively copy the local vtk.js directory into node_modules instead of creating a soft link, there are no issues. So it seems to be an issue only with soft linking...

psavery commented 4 years ago

This issue was also confirmed by @floryst

thewtex commented 4 years ago

I have also experienced this.

dannyrb commented 4 years ago

We experience this issue in our own project (react-vtkjs-viewport) when attempting this as well. I assumed it was related to how WebPack treats symlinked dependencies. We haven't investigated the issue thoroughly -- just making note.

CC: @jamesapetts

floryst commented 4 years ago

Yup my initial investigation surrounds webpack and symlinked deps. Might dig into it later.