Control.setPaddingInPixels() not defined in TypeScript

The TypeScript code here:

let button = BABYLON.GUI.Button.CreateSimpleButton("test", "click");

causes this TSC TypeScript error:
error TS2551: Property 'setPaddingInPixels' does not exist on type 'Button'. Did you mean 'paddingTopInPixels'?

The code works correctly in JavaScript but it errors in TypeScript. Is the method not defined in TypeScript?

Can you repro in the playground (on TS side of course)?

Yes - the API isn’t in 4.2 - which is the version I’m using.
Strange because the code works in JavaScript for me but fails in Typescript.

Are you sure you are not referencing 5.0 (from the preview cdn?)

My web page references

And my package.json includes these dependencies:

“babylonjs”: “^4.2.0”,

“babylonjs-gui”: “^4.2.0”,

“babylonjs-materials”: “^4.2.0”,


That is REALLY weird!

It does not work in a JS playground when you switch to 4.2: Babylon.js Playground