Some playgrounds not working after last update?

Hi
As the title say. Some pgs not working. I suspect the last upgrade on pg side, but not sure:
https://www.babylonjs-playground.com/#02PXM2#1
https://www.babylonjs-playground.com/#11W1Y5#4
https://playground.babylonjs.com/#437YI8#1
and few more…
different ‘strange’ errors
image
image
image
Please check

https://playground.babylonjs.com/#EYEPRI#3,
https://playground.babylonjs.com/#HI65FJ#0,
https://playground.babylonjs.com/#7G0IQW#0 - from example section

few fixed examples fix some examples by Bulisor · Pull Request #1654 · BabylonJS/Documentation · GitHub
aaand looks like ts version of pg is not working too. At least the examples are not working, even if I’m on typescript, when I click on an example it moves to js.
And the same for ts pgs.
This https://www.babylonjs-playground.com/ts.html#3BIQ4K#3 redirect to https://www.babylonjs-playground.com/

Some interesting issues and some further observations

Plenty of TS PGs do work (found from Playground menu in docs searching for public static, eg
https://www.babylonjs-playground.com/#0X3431#1

Behaves as if this PG cannot be found so reverts to basic scene in javascript

Behaves as if this PG cannot be found so reverts to basic scene in typescript as ts.html indicates

Remove the comment on the first line of this (without deleting line) and you get a new error delayCreateScene is not a function and delete the first two lines and you get unexpected token: identifier
However using this PG as a starting point https://www.babylonjs-playground.com/#J62R3F#1 and copying and pasting the code from #11W1Y5#4 you get https://www.babylonjs-playground.com/#J62R3F#4 , which as far as I can see is the same code, and works??

1 Like

Will have a look ASAP!

thanks a lot guys for the repros!

Hi MarianG,

A fix is to declare createScene or delayCreateScene functions as varibles like so:

var createScene = function () { … };

Was your script successfully working with previous playground version ?

Hi @noalak and welcome to the forum. Well spotted on the difference between #11W1Y5#4 and #J62R3F#4 I had been looking at it for ages and never spotted the obvious.

Me too :joy:
Most of the fixes i did for few examples was to simple add ‘var’ to few variables, but I completly forgot for createScene.
Looks like the compiler is more restrictive and carefull with the sintax, which is good, but maybe need the errors to be more specific, I don’t know.

Yes @noalak. All of them worked in the previous. One of them is the ‘racing pg’ of Mackey, and it is recent.

Agree. Seems that there is now a strict mode applied to the playgrounds. In this PG, for example, https://www.babylonjs-playground.com/#3RTT8P#9 gives the error assignment to undeclared variable pivotAt, the addition of var to lines 46 and 47 gets it working again.

@PatrickRyan @Deltakosh Strict mode is all well and good if applied from the start, applying it now will mean hundreds of PG will now have the potential to fail.

Yeah, the two MeshWriter PGs that github and NPM refer to now fail for missing ‘var’ statements.

I will fix them but it will take a while to straighten everything out. I cannot, for example, update the PG pointers in NPM unless I turn a new rev. That will be this weekend.

we will make sure to fix all of that so there will be NO backward issues :slight_smile: @noalak

1 Like

Ok I think I fixed everything
Please ping me if you find not working PGs

1 Like

Greeeeeaaaat news!
From what I checked ( btw I have a long long list with pgs :yum: ) they seem to work, at least for javascript. With typescript I’m stil having the issue with redirect to https://www.babylonjs-playground.com/ (ts version). All pgs (ts version) from my list redirect to base_url :frowning:

few examples:
// racing car - mackey- unitytool
https://www.babylonjs-playground.com/ts.html#3BIQ4K#3

// clipping object
https://www.babylonjs-playground.com/ts.html#JP05DS#2

// animated butons
https://www.babylonjs-playground.com/ts.html#M2ACRT#3

// export only a specific mesh as glb/gltf
https://www.babylonjs-playground.com/ts.html#8V0SQZ#0

Yep let see if @noalak can have a look to the redirect for TS

Turns out I was wrong. On closer inspection, like the one above, there is no ts.html in the url, and were probably the ones written to test the new playground. The existing ones that have the form
http://www.babylonjs-playground.com/ts.html#ABCDE#xx redirect to http://www.babylonjs-playground.com/#ABCDE#xx which may or may not exist and hence the redirect to the default.