'vtkProxyManager' is a type and must be imported using a type-only import...

I’m working on a Vue 3 / Pinia / TS project that uses VTK.js. In my Pinia store (successor to Vuex) I’m getting the following TS error:

TS1444: ‘vtkProxyManager’ is a type and must be imported using a type-only import when ‘preserveValueImports’ and ‘isolatedModules’ are both enabled.

The code works as-is and I could certainly disable one of the the two options listed, but my preference would be to understand if there is a better way I should import vtkProxyManager to avoid this error. My current import looks like this:

import vtkProxyManager from '@kitware/vtk.js/Proxy/Core/ProxyManager';

Later I use vtkProxyManager like this:

// proxyManager is part of Pinia state
proxyManager.value = vtkProxyManager.newInstance({ proxyConfiguration });

If anyone has any pointers, I’d appreciate them!

TIA,
Dave

Ah, that’s a copy-n-paste bug in the types for vtkProxyManager. I can fix it.

1 Like

This should be fixed in the latest version of vtk.js: fix(ProxyManager): export usable type by floryst · Pull Request #2769 · Kitware/vtk-js · GitHub

1 Like