Skip to content

Cannot read property 'isUniformUsed' of null in PublicAPI.setMapperShaderParameters #1814

@chucksspencer

Description

@chucksspencer

We're trying to integrate vtk.js into an existing react app (create-react-app). We ejected the app and made the changes to webpack per the documentation and got it building and running. However when we try to render anything we get the following error at runtime:

TypeError: Cannot read property 'isUniformUsed' of null publicAPI.setMapperShaderParameters node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js:1113

Code

We're just trying to get a simple example rendering using the following code from various samples. All we're trying to do is render a simple cone.

    const coneSource = vtkConeSource.newInstance({ height: 1.0 });

    const mapper = vtkMapper.newInstance();
    mapper.setInputConnection(coneSource.getOutputPort());
    
    const actor = vtkActor.newInstance();
    actor.setMapper(mapper);    

    this.renderer.addActor(actor);
    this.renderer.resetCamera();

If we exclude the this.renderer.addActor(actor); line that actually adds the actor, we do not see this error - simply the blank black window.

Screenshots

Here's a partial stack trace from the error:
image

vtk.js version:
"vtk.js": "^17.2.2",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions