Dear all:
I did not do any change in my code.
However suddenly, It goes wrong.
May anyone tell me what happened ? thank you
It seems that library files are out of sync in your project. Please ensure that you are not including three.js
more than once.
2 Likes
I got this error with a library/package that was using Three.js version 0.128.0 and another library that was using instead 0.126.1. Upgrading the Three.js version of this last to 0.128.0 solved the issue. If you need more infos look at this my PR Testing new ARnft and ARnft-threejs package by kalwalt · Pull Request #15 · kalwalt/ARnft-ES6-react · GitHub
1 Like
@Mugen87
Thanks for pointing me to this thread.
I was using another library three-mesh-ui by @felixmariotto which was using v0.122.0 ( in its latest release) as a dependency which caused the issue mentioned here:
opened 11:24AM - 28 May 21 UTC
closed 01:59PM - 28 May 21 UTC
Help (please use the forum)
ShaderMaterial/SpriteMaterial does not work in the WebXR immersive mode. We h… ave a WebXR application that worked well up to r127. Today when I upgrade to 0.129.0 I get this error because of my custom object/material. If I create the object/shadermaterial or spritematerial not at startup but at a much later at runtime (after loading a gltf object).
Steps to reproduce the behavior:
1. Create a WebXR example with an object and ShaderMaterial class
2. Enter VR
3. You will see an error that looks like this:

Likely broken because of the change at these commits ?
https://github.com/mrdoob/three.js/commit/f2e4e0fe94d927ed9712f1189bd66d20992f061e#diff-fc94afb5da943fea9e01a4a16adf82b5433aa6d61af5855f296158a98ed4dcfd
https://github.com/mrdoob/three.js/pull/21117/commits/acb1dd46ac9ff7208070c86726984aebce11a27f
**Expected behavior**
ShaderMaterial should have an onBuild method which it inherits from the base Material class. Although it does have the onBuild() method available at creation time, during render() the method seems to vanish after pushing to it the renderListStack @ line 24504
**Screenshots**

**Platform:**
- Device: [Desktop]
- OS: [Windows]
- Browser: [Chrome]
- Three.js version: [r128,r129]
Updating the dependency to r129 in three-mesh-ui fixed the issue
Thanks!
3 Likes
Which version of three-mesh-ui do you use ?
I updated the three.js dependancy version to r128 about a month ago, which seemed to fix the problem. The last three-mesh-ui version is 4.6.1.
1 Like
I was using version 4.5.1
1 Like