Bug with decorators on babylonjs editor

Hello guys,
I am hyped about the latest babylonjs editor version, and wanted to have a go at the decorators, but I can’t get them to work, even on the default scene. What am I doing wrong ?

I have tried different patterns, wordings. The best I got was this error in the editor chrome inspector when it was not just plain compiler errors :

Config : Windows 11
Version : 5.2.1
Template : Solid
Node : v22.17.1
yarn : 1.22.22

1 Like

Hey @Wellandr !
Thanks for reporting!

I’m sad that you do nothing wrong, I’m on it and I’ll find the problem.

Ok I found the problem. It looks like your script has no values exported (this should be handled automatically, nothing you can do). At least I reproduced the same error by removing the values myself.

Here when you attach a script to an object in the scene, ESBuild is called automatically to extract the decorated properties at runtime. Maybe there is a problem with ESBuild when running on your system.
I’ll go on a Windows machine ASAP and test if I reproduce as I can’t reproduce on a Mac for now :frowning:

1 Like

That could be my machine, please let me know if you succeeded in reproducing the error !

This is my main assumption but we’ll have to verify that :slight_smile:

@Wellandr OMG I finally found the issue!!!
I’m releasing a fix ASAP, it was located in the editor

1 Like

What was it ??

It was the scripts were exported as ESM modules and it was just not supported anymore. A mistake I resolved and added a test to ensure it’ll not happen again :slight_smile:

Just released the fix, you can download the new version here: Babylon.js Editor
Since I started signing the Windows builds, the auto-updater doesn’t work when updating from a non-signed build to a signed-build. So you’ll have to re-download and re-install just for this time


sweet !

The controls for this one below are a tad sensitive, but I can get used to it !

@visibleAsNumber("bla", {
    min: 0,
    max: 1,
    step: 0.1,
  })
1 Like

I think the step when moving mouse can be optimized, let me try something :slight_smile:

1 Like