Unexpected token 'export' when exporting scenes?

For each script that includes export, remove the <script> for it. The imports should all go through game.js.

Also, final scene setup in the tutorial is more complicated than it needs to be. You can just use

import TitleScene from './titleScene.js';
import GameScene from './gameScene.js';

var config = {
  type: Phaser.AUTO,
  width: 800,
  height: 600,
  scene: [ TitleScene, GameScene ]
};

var game = new Phaser.Game(config);
1 Like