Animations not working in production build

I recently updated Babylonjs from version 7.2 to 8.33 and everything worked fine until I made a production build. Then my animations seems to have stopped working, but there are no errors at neither build nor runtime.

I suspected (and still do to some extent) that it had to do with tree shaking, but I have tried anything I can come up with efter reading the docs on ES6 support. I’m not sure I did everything right though.

But since the dev version works and the build version does not I don’t know what else it could be? And it feels rather pointless to do a playground considering that it would most likely work there.

I both have an animated texture triggered with Animation.CreateAndStartAnimation(“u”, mesh.material.bumpTexture, “uOffset”, 30, 300, 0, 1, 1)

And some camera animations triggered with this.scene.beginAnimation(camera,0,60,false,1.0,callbackDone?callbackDone:null)

ANd looking in inspector it looks fine, the animations are attached to the camera and I can open the animation graph and move the slider, which will change the properties as expected. But pressing play does nothing. Not even a warning or error message.

I also tried to disable any tree shaking, but still had the same result.

I am running in a react project created with vite.

If anyone has any suggestions on what to try next, I would be grateful for any help.

Welcome aboard!

Are you able to setup a live link so that we can have a look?

Also, you could try to set a breakpoint on Animation.CreateAndStartAnimation and see if there’s something which prevents the animation to start.

Sorry for being inactive, but it seems this problem was actually caused by silent failure of using svg in a Texture constructor (as a data url). Don’t know why it was only visible in production at first beacuse later it was possible to reproduce in development too, guess I must have had some mismatch in my environment after upgrading Babylonjs. Rendering the svg to a canvas and then using the bitmap for texture creation made animations work again.