Uncaught TypeError: renderer.getDrawingBufferSize is not a function at new THREE.EffectComposer

When trying to create a composer in my index.js file, I’m getting error “Uncaught TypeError: renderer.getDrawingBufferSize is not a function at new THREE.EffectComposer”. It seems to point to the EffectComposer.js file but I’m not sure how to remedy this, since I’ve not done anything to modify any of the THREE files, EffectComposer files. I’ve called all the necessary files including copyshader, shaderpass and renderpass. Scoured the interwebs but can’t find anything.

Please help!

When creating an instance of EffectComposer, you have to pass in an instance of WebGLRenderer. It’s a mandatory argument.

I believe I did that with “var renderer = new THREE.WebGLRenderer();”. I would post a codepen but honestly I’m using so many libraries at this point, I wouldn’t even know where to start XD…

What is the purpose of your codepen? The problem seems obvious to me. You are not applying a renderer when creating EffectComposer. Please show with a live example if that’s not the case.

Sorry, I posted the wrong pen. Please check out my index.js file, if you could. I’m pretty sure I passed the renderer correctly. I’m following a tutorial on the subject but can’t seem to get it to work. Thank you in advance.


You are importing all post processing related files from the wrong directory. They are not in lib/postprocessing but just in postprocessing.

You replied so quickly I didn’t have a chance to clean up and save a couple things in the codepen. That was just a problem with codepen, not the code. I think the directory should be correct now.


This is the error I’m trying to figure out.

Why are you using R85 and not the latest version of three.js (which is R98)?WebGLRenderer.setDrawingBufferSize() was added with R86.

Keep in mind that the version of three.js and the examples files always have to match.

That’s really strange, I thought I pulled whatever version was included with the threejs.org download… Now that I’ve re-downloaded and switched it out, the error seems to have disappeared. Now replaced by another pain-in-my-you-know-what error “TypeError: THREE.Renderpass is not a constructor” but I’ll try and figure that out on my own.

Thanks for your help and sorry for such a stupid problem. :cold_sweat:

Keep going! :slight_smile: