In phaser 3 I get this error when restarting scene

phaser.min.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'sys')
    at initialize [as constructor] (phaser.min.js:1:152081)
    at initialize [as constructor] (phaser.min.js:1:360092)
    at new initialize (phaser.min.js:1:628349)
    at initialize.create (phaser.min.js:1:238737)
    at Game.generateNextPlatforms ((index):116:19)
    at Game.generatePlatforms ((index):177:9)
    at Game.update ((index):223:8)
    at initialize.step (phaser.min.js:1:966940)
    at initialize.update (phaser.min.js:1:954010)
    at initialize.step (phaser.min.js:1:76119)

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	<script src="https://cdn.jsdelivr.net/npm/phaser@3.80.1/dist/phaser.min.js"></script>

	<title> Game </title>

<style>
	
body{
	margin: 0;
	padding: 0;
	background: #000;
	overflow: hidden;
}

</style>
</head>
<body>

<script>
	

class Game extends Phaser.Scene{
	constructor(){
		super({
			key: "Game",
			physics: {
				default: "arcade",
				arcade: {
					debug: false
				}
			}
		});
	}
	preload(){
		this.load.setBaseURL("assets");

		this.load.image("background", "background.png");

		this.load.image("play", "play-button.png");

		this.load.image("platform", "island.png");

		this.load.image("player", "character.png");

		for (let i = 1; i <= 4; ++i){
			this.load.image(cloud${i}, cloud${i}.png);
		}
	}
	create(){
		this.addBackground();
		this.addUI();
		this.addClouds();
	}
	randomBetween(min, max){
		return (Phaser.Math.Between(min, max));
	}
	addBackground(){
		this.background = this.add.image(400, 600, "background").setScale(1.4).setScrollFactor(0);
	}
	addUI(){
		this.playButton = this.add.image(400, 600, "play").setInteractive().setDepth(Infinity);

		this.playButton.on("pointerdown", () => {
			this.playButton.destroy();

			this.startGame();
		});
	}
	generateClouds(){
		for (let i = 0; i < this.randomBetween(1, 4); ++i){
			const cloud = this.physics.add.image(this.randomBetween(-500, -100), this.randomBetween(0, 1200), cloud${this.randomBetween(1, 4)}).setScrollFactor(1, 0);

			cloud.setGravity(0);

			cloud.setVelocityX(this.randomBetween(10, 100));

			this.clouds1.push(cloud);
		}

		for (let i = 0; i < this.randomBetween(1, 4); ++i){
			const cloud = this.physics.add.image(this.randomBetween(900, 1300), this.randomBetween(0, 1200), cloud${this.randomBetween(1, 4)}).setScrollFactor(1, 0);

			cloud.setGravity(0);

			cloud.setVelocityX(this.randomBetween(-100, -10));

			this.clouds2.push(cloud);
		}
	}
	addClouds(){
		this.clouds1 = [];

		this.clouds2 = [];

		this.generateClouds();

		this.time.addEvent({
			delay: this.randomBetween(10000, 20000),
			callback: () => {
				this.addClouds();
			}
		});
	}
	startGame(){
		this.createPlatforms();
		this.createPlayer();
		this.createControls();
	}
	generateNextPlatforms(){
		for (let i = 0; i < 4; ++i){
			this.platforms.create(this.randomBetween(100, 700), this.platformY, "platform").setScale(2).setDepth(1);
		
			this.platformY -= 300;
		}
	}
	createPlatforms(){
		this.platforms = this.physics.add.staticGroup();

		this.firstPlatform = this.platforms.create(400, 1100, "platform").setScale(2).setDepth(1);

		this.platformY = 800;

		this.generateNext = 500;

		this.generateNextPlatforms();
	}
	createPlayer(){
		this.player = this.physics.add.image(400, 1000, "player").setScale(1.5).setDepth(2);
	
		this.player.lost = false;

		this.player.body.setGravityY(1200);

		this.cameras.main.startFollow(this.player);

		this.cameras.main.setBounds(0, 0, 800, 1200, true);

		this.physics.add.overlap(this.player, this.platforms, () => {
			if (this.player.body.velocity.y >= 0){
				this.player.setVelocityY(-1000);
			}
		});
	}
	createControls(){
		this.input.keyboard.on("keydown", (event) => {
			if (event.key === "ArrowLeft"){
				this.player.setVelocityX(-500);
			}

			if (event.key === "ArrowRight"){
				this.player.setVelocityX(500);
			}
		});

		this.input.keyboard.on("keyup", (event) => {
			if (event.key === "ArrowLeft" || event.key === "ArrowRight"){
				this.player.setVelocityX(0);
			}
		});
	}
	updateCameraBounds(){
		if (this.player){
			if (!this.player.lost){
				this.cameraBound = this.player.y - 1200;

				this.cameras.main.setBounds(0, this.cameraBound, 800, 2000, true);
			}
		}
	}
	generatePlatforms(){
		if (this.player){
			this.generateNextPlatforms();
		}
	}
	checkPlayerLost(){
		if (this.player && !this.player.lost){
			const lastPlatform = this.platforms.getChildren()[0];

			if (this.player.y > lastPlatform.y + 500){
				this.player.lost = true;

				this.scene.restart();
			}
		}
	}
	removeObjects(){
		if (this.player && !this.player.lost){
			this.clouds1.forEach((cloud) => {
				if (cloud.x > 900){
					this.clouds1.splice(this.clouds1.indexOf(cloud), 1);

					cloud.destroy();
				}
			});

			this.clouds2.forEach((cloud) => {
				if (cloud.x < -100){
					this.clouds2.splice(this.clouds1.indexOf(cloud), 1);

					cloud.destroy();
				}
			});

			if (this.platforms){
				this.platforms.children.each((platform) => {
					if (platform.y > this.player.y + 700){
						this.platforms.remove(platform);

						platform.destroy();
					}
				});
			}
		}
	}
	update(){
		this.checkPlayerLost();
		this.updateCameraBounds();
		this.generatePlatforms();
		this.removeObjects();
	}
};

const game = new Phaser.Game({
	type: Phaser.AUTO,
	width: 800,
	height: 1200,
	scale: {
		mode: Phaser.Scale.FIT,
		autoCenter: Phaser.Scale.CENTER_BOTH
	},
	scene: [Game]
});

</script>
</body>
</html>