Uncaught TypeError: Cannot read properties of undefined (reading 'queueDepthSort')

Hi, I’m getting an Uncaught TypeError: The undefined properties cannot be read (reading ‘queueDepthSort’) when using this.add.block from my game scene, where block is a custom game object created using
export class Block extends Phaser.GameObjects.Container {
constructor(scene, x, y, fill color) {
super(scene, x, y);
scene.add.existing(this);…

console shows that error is in ‘super’ of block class, idk what can be wrong

and added to the stack of objects from the game scene
initialization function
init() {
Phaser.GameObjects.GameObjectFactory.register(‘block’, (x, y, color) => {
block var = new block(this.scene, x, y, color);
the return block;
});…
I use phaser 3.60.0 and bundle my game with parcel 2, so my index.html contains only phaser.min.js and game.js .

Don’t use an arrow function in register().