Object with multiple materials and Raycaster interaction crashes tab

So I was trying to put text on colored cubes using texture. I read somewhere that I can do this by using multiple materials and BoxBufferGeometry. Things were working pretty fine. Then I tried adding Raycaster. Page still loads fine, but when I click on one of the cubes, my tab immediately crashes. I tried switching to regular geometry and material and Raycaster works fine again, but now I can’t use double material. How can I make it work?

Can you please share a live example demonstrating the crash? E.g. by sharing a fiddle?