Cannot find namespace 'VtkOpenGLRenderWindow0'

I set up an Angular app that works well with GenericRenderWindow as well as FullScreenRenderWindow.

However, I can’t seem to be able to use OpenGL/RenderWindow:

import vtkOpenGLRenderWindow from ‘@kitware/vtk.js/Rendering/OpenGL/RenderWindow’;

Error: node_modules/@kitware/vtk.js/Rendering/OpenGL/RenderWindow.d.ts:268:23 - error TS2503: Cannot find namespace ‘VtkOpenGLRenderWindow0’.

Any ideas?

When I am using WebAssembly with VTK I have to use a vtkSDL2OpenGLRenderWindow instead of vtkOpenGLRenderWindow. Not sure if that applies to vtk.js or not.

This appears to be a typo in the d.ts file for the OpenGLRenderWindow. I will update this thread once it has been resolved.

1 Like

I have imported this from vtk.js
import vtkOpenGLRenderWindow from ‘vtk.js/Sources/Rendering/OpenGL/RenderWindow’;

Getting the same type error. Any fixes for this will be helpful.

PR is available here: fix(OpenGL/RenderWindow): fix auto-generated types by floryst · Pull Request #2142 · Kitware/vtk-js · GitHub

1 Like

There are two typo errors coming please check.

141: normalizedDisplayToViewport(x : number, y : number, z : number, renderer : vtRenderer): Vector3;

vtRenderer should be - vtkRenderer

175: viewportToNormalizedDisplay(x : number, y number, z : number, renderer : vtkRenderer): Vector3;
y number should be y: number

Thanks for catching those. My editor must have not reloaded the types when I tested it. Typo fix: fix(RenderWindow): fix def typos by floryst · Pull Request #2144 · Kitware/vtk-js · GitHub

2 Likes