Running Babylon.js on server gets error when using GUI.AdvancedDynamicTexture.CreateForMesh()

I am running Babylon.js on a node server.
When I call GUI.AdvancedDynamicTexture.CreateForMesh(plane), I get the error
ReferenceError: OffscreenCanvas is not defined.
is this because DynamicTexture cannot be used as they rely on HTML canvas?

Yes, I am pretty sure it is. The part which a webGL context cannot do, which 2d canvas context can, is interact with fonts. They really do not mean anything to a GPU. This is also an obstacle for BABYLON native, which is also lacking a DOM as well.


Yes, this is true for Babylon Native, but we (or really just @Cedric) are working on a polyfill. Canvas polyfill PoC by CedricGuillemet · Pull Request #441 · BabylonJS/BabylonNative (

1 Like

I confirm what @bghgary says. We are working on a Canvas polyfill. It’s a WIP. No ETA yet.