Skip to content

renderer.compile throws "Cannot read property 'state' of null" #22217

@LinoPhil

Description

@LinoPhil

Describe the bug

Hi THREE Team,

in my viewer I load meshes at runtime. To reduce stuttering I call renderer.compile after new meshes/materials where added to the scene. Everything worked fine till 131.

Now compile crashes with:
three.module.js:26024 Uncaught TypeError: Cannot read property 'state' of null
at getProgram (three.module.js:26024)
at three.module.js:25554
at Mesh.traverse (three.module.js:6982)
at Scene.traverse (three.module.js:6988)
at WebGLRenderer.compile (three.module.js:25542)

To Reproduce

You need a scene with:

  1. scene.environment = textureCube; // where textureCube is a simple 6 jpg cubemap
  2. while the scene is running.. animationloop add a new mesh with multimaterial
  3. call renderer.compile on the scene

Live example

https://jsfiddle.net/pchy41r6/94/

Expected behavior

no exception would be nice :)

Platform:

  • Device: [Desktop]
  • OS: [Windows]
  • Browser: [Chrome]
  • Three.js version: r131

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions