TypeError: Cannot read property 'transparent' of undefined (renderObjects)
See original GitHub issueDescribe the bug Bug appears when I use EffectComposer. More precisely in the RenderPass. To Reproduce In my scene I use (from 131.3)
import * as THREE from 'three';
import { EffectComposer } from '../vendor/postprocessing/EffectComposer.js';
import { RenderPass } from '../vendor/postprocessing/RenderPass.js';
...
var renderer = new THREE.WebGLRenderer();
var composer = new EffectComposer(renderer);
...
composer.addPass(renderPass);
composer.addPass(copyPass);
...
composer.render(delta);
Code above worked without any issues on an older version of Three.
I was able to find and fix the issue. In function renderObjects(renderList, scene, camera) you can find an assignment
const material = overrideMaterial === null ? renderItem.material : overrideMaterial;
If overrideMaterial material is undefined, then it will assign undefined to the material and crash later in renderObject function. Probably, it’s better to use “==” instead of “===”. It fixes the problem.
Platform:
- Device: desktop
- OS: [Windows, MacOS]
- Browser: [Chrome]
- Three.js version: [dev, r131.3]
Issue Analytics
- State:
- Created 2 years ago
- Comments:15
Top Results From Across the Web
TypeError: Cannot read property 'transparent' of undefined #26
Hi, I'm using Gatsby and if I use "bg-", it throws the following error: const NuForm = styled(Form)` ${tw`bg-transparent uppercase ...
Read more >Uncaught TypeError: Cannot read property 'opacity' of undefined
Try this. $(document).ready(function(){ $("#addtask").click( function() { var opacity = $("#taskinput").css("opacity"); ...
Read more >Object3D – three.js docs
Object3D. This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in...
Read more >TypeError: Cannot read properties of undefined (reading 'filter')
Im trying to make a search bar to search in an array of fruits but I keep getting the following error: TypeError: Cannot...
Read more >CIQ.ChartEngine - ChartIQ Documentation
You can also set the main htmlControls object to null to disable all controls ... panels no longer dependent on this property and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe this is would be a safer pattern:
switch to Babel you already will see an issue