New Playground Breaking Changes

Yo @Deltakosh

There seems to be some breaking changes in the playground. I uses to use an async version of createScene so i can bootstrap Ammo.js.

This used to work fine, now it gets and TypeScript Promise error:

 public static async CreateScene(engine: BABYLON.Engine, canvas: HTMLCanvasElement): Promise<BABYLON.Scene> {
        // This creates a basic scene object (non-mesh)
        var scene = new BABYLON.Scene(engine);

        // This initializes bullet physics (non-mesh)
        const wnd:any = window;
        if (!wnd.ammoLoaded) {
            wnd.Ammo().then(function(){ 
                wnd.ammoLoaded = true;
                Playground.LoadScene(scene);
            });
        } else {
            Playground.LoadScene(scene);
        }

        // This save current scene for debugging
        (<any>window).scene = scene;
        return scene;
    }

Now gets this error:

An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.

How can i do async static functions on the playground now ???

Will be fix in a hour or so

3 Likes