Material.onError fails to catch exception (Worked in Babylon 3, but not 4)

We’ve been using the workaround here:

Where you set usePercentageCloserFiltering false onError.

With BabylonJS 4.0.3, the callback fires correctly, but the exception that triggered it is uncaught and crashes the app.

As a workaround for the workaround catching and ignoring errors from scene.render works and the shadows recover as expected.

Playground here, but it will only trigger on a buggy device, like our Chromebook:

https://playground.babylonjs.com/#VBW3TW

Pinging @sebavan

Could you try on this page: Babylon.js Playground

and let me know where the exception is thrown from ???

I unfortunately do not have a device I can test on to reproduce.

Actually, I found a way to repro. It is a bit convoluted :slight_smile: I will fix it by end of day.

Fixed, creating a nightly now :slight_smile:

The playground works on our chromebook now.

Thank you!