It is link to a form which allow to change the model ( adjust length, height even add/remove some optional part).
My only dependencies are threejs and vite. My configurator work fine on my localhost. Yet i have some issue with my build. In production I can edit my product dimension but when I try to add or remove a part with my form, i have rendering issue.
I have make several try to resolve the issue, checking the scene object in the console to verify if the piece are in the rght place, check that if i remove the if else condition the part load fine âŚ
Yet I was not able to resolve this.
I also have this warning inside my console which I was not able to solve until now:
WebGL warning: uniform setter: UniformLocation is not from the current active Program. 3
After reporting 32, no further warnings will be reported for this WebGL context.
Im not really use to make npm package running on code pen so it took me some time but there it is: https://codepen.io/Fordreas/pen/RNNzpaz
In this sample from my code select option Largeur, Longueur and Hauteur work fine but if the try to select the option âSansâ on âEntourageâ it break as it deed on my production server
Your application appears to be loading different versions of threejs at the same time.
The change listener on the fields is calling âmainâ each time with the different parameters, which is recreating the renderer on every parameter change.
The previous renderer is never disposed however, so its render loop will still be running.
fixes:
I added an âimportmapâ to your html to properly set up the paths to threejs, so that different versions arenât loaded.
I changed the code to only create one rendererer at init time.
I separated your renderer creation out into a separate method that gets called once at init timeâŚ
âmainâ now just recreates the hall object after disposing/removing the previous one.
Thank, i Have implement your suggestion on my main project and it resolves the issue for the rendering and the warning in both localhost and production.