Migrating from r143 to r159 results in undefined (reading 'texture')

The best approach to debugging this would be to set a breakpoint at the line throwing the error (three.module.js:1692) in Chrome Dev Tools (or your browser of choice), or configure it to pause on the next uncaught error. Then you’ll be able to step up/down the call stack and see more specifically what’s happening.

Taking a guess though, perhaps some texture’s .encoding or .colorSpace property has been deleted — they aren’t supposed to be null or undefined. three.js r152 had some relevant changes described in Updates to Color Management in three.js r152. Assigning texture.colorSpace on whatever texture this is might fix the error. If it’s an HDR texture (.hdr or .exr for example) then you probably want THREE.LinearSRGBColorSpace. If it’s a non-HDR cubemap then you probably want THREE.SRGBColorSpace; If it’s not color data at all (normalMap, aoMap) then THREE.NoColorSpace.