ES6-style script definition not working anymore in v1.52.1


I’ve noticed that ES6-like script definition has stopped working in 1.52.0/1.52.1.
For example:

class Something extends pc.ScriptType {

    initialize() {

    update(dt) {


pc.registerScript(Something, 'something');

Here is the test project:
And two test links (please open the console to see script’s debug output)
1.51.7 is working fine:
1.52.1 is not working:

Is there a way to use the ES6 classes/inheritance? I know you guys have been converting the codebase to TS/ES6 last months, right?

@will Something for you?

Looks fine here?

Edit: Oooh, there should be console output right?

It’s likely due to be because of this change:

We are still working through the issues on engine 1.52 regarding type script and issues like this.

Many thanks for testing and reporting this, it really does help us a lot!

1 Like

Also, there is an issue with parsing inherited scripts in the editor. This is not something special to 1.52.x, I noticed it way before.

For example, let’s define a base class named Primitive

class Primitive extends pc.ScriptType {

Then extend it with the Box class:

class Box extends Primitive {

Attaching the Primitive script to an entity works well, but it breaks once I want to attach & parse the inherited Box class:

Is says the base class is not defined. Though the inheritance works (or rather worked till 1.52.x: ) ) well when you launch the project. That makes impossible using the script attributes.

@Igor that one is known: