How to laod vtk.js

Hi I have a stubborn module that I need helping using.

Here is a sample notebook:

When the page loads vtk is undefined, but if you redefined vtk as something else, then unassign it Observable will recognize vtk as the vtk.js module. Is there a proper hack to get this to work properly on page load?

Thanks in advance!

I think this works

vtk = {
  await import('')
  return window.vtk

BTW the way dynamic imports should work is

vtk = (await import('')).default

but this has been packed a bit strangely so the default doesn’t seem to have any exports. (Not the 1st time.)

1 Like

Thanks so much!