# Issue adding multiple scenes to config file

**URL:** <https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372>\
**Category:** Phaser 3\
**Created:** [May 19, 2020, 1:17pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372 "2020-05-19T13:17:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JgregoriBb](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@JgregoriBb](https://phaser.discourse.group/u/JgregoriBb)\
**Post date:** [May 19, 2020, 1:17pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372/1 "2020-05-19T13:17:09Z")

</div>

Hi

I am following an online tutorial that breaks the game into separate scenes (each one in its js file) and then adds them in an array to the config file. this is my code

```
var config ={
type:Phaser.AUTO,
width: 800,
heigh: 600,
**scene: [**

```

\*\* BootScene,\*\*  
\*\* GameScene,\*\*  
\*\* TitleScene,\*\*  
\*\* UiScene,\*\*  
\*\* ],\*\*  
physics:{  
default: ‘arcade’,  
arcade:{  
debug: true,  
gravity:{  
y:0,  
},  
},  
},  
};

var game = new Phaser.Game(config);

I get the following error **main.js:6 Uncaught ReferenceError: BootScene is not defined**

Files are correctly referenced in the html file

Files themselves extend the Phaser.Scene class, as an example

class GameScene extends Phaser.Scene{  
constructor(){  
super(‘Game’);  
}

```
preload(){

}

create(){
    
}

```

}

I have tried with the current stable version of Phaser3, 3.23.0 and the previous version 3.22.0 Can anyone help me figure out where the problem is?

Thank you! much appreciated!

---

<div class="post-metadata">

**Author:** ![Darko](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/darko/32/3335_2.png) [@Darko](https://phaser.discourse.group/u/Darko)\
**Post date:** [May 19, 2020, 1:43pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372/2 "2020-05-19T13:43:27Z")

</div>

Hello, that looks like a path or import error…  
Do you have a correct path?  
Did you do the correct import at the top of your main file?

` import BootScene from "my_scenes_path/boot_scene";`

---

<div class="post-metadata">

**Author:** ![JgregoriBb](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@JgregoriBb](https://phaser.discourse.group/u/JgregoriBb)\
**Post date:** [May 19, 2020, 5:12pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372/3 "2020-05-19T17:12:02Z")

</div>

Thanks Darko

Unfortunately no, when I follow your suggestion I get **Uncaught SyntaxError: Cannot use import statement outside a module**

I am creating classes, not modules, so that may be why this is not working

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [May 19, 2020, 6:35pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372/4 "2020-05-19T18:35:35Z")

</div>

What is the HTML?

---

<div class="post-metadata">

**Author:** ![JgregoriBb](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@JgregoriBb](https://phaser.discourse.group/u/JgregoriBb)\
**Post date:** [May 19, 2020, 6:46pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372/6 "2020-05-19T18:46:20Z")

</div>

Hi samme

This is the html

```
> <!DOCTYPE html>
> <html>
> <head>
> <meta charset="utf-8">
> <meta name="viewport" content="user-scalable=0, initial-scale=1, minimum-scale=1, maximum-scale=1, width=device-width, minimal-ui=1">
> <title>RPG course</title>
> </head>
> <body>
> <div id="phaser-game"></div>
> <script type="text/javascript" src="assets/js/lib/phaser.min.js" charset="utf-8"></script>
> <script src="assets/js/main.js" charset="utf-8"></script>
> <script src="assets/js/scenes/BootScene.js" charset="utf-8"></script>
> <script src="assets/js/scenes/GameScene.js" charset="utf-8"></script>
> <script src="assets/js/scenes/TitleScene.js" charset="utf-8"></script>
> <script src="assets/js/scenes/UiScene.js" charset="utf-8"></script>
> </body>
> 
> </html>
```

---

<div class="post-metadata">

**Author:** ![Darko](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/darko/32/3335_2.png) [@Darko](https://phaser.discourse.group/u/Darko)\
**Post date:** [May 19, 2020, 6:52pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372/7 "2020-05-19T18:52:11Z")

</div>

Load files in order… main.js needs BootScene.js? Then I guess BootScene should be loaded before main.js probably…

---

<div class="post-metadata">

**Author:** ![JgregoriBb](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@JgregoriBb](https://phaser.discourse.group/u/JgregoriBb)\
**Post date:** [May 19, 2020, 6:58pm UTC](https://phaser.discourse.group/t/issue-adding-multiple-scenes-to-config-file/6372/8 "2020-05-19T18:58:57Z")

</div>

Yay! thank you so much, it was load order for the files. Main needs to be the last to load!
