# "type: Phaser.AUTO," results in "Phaser is not defined" console error

**URL:** https://phaser.discourse.group/t/type-phaser-auto-results-in-phaser-is-not-defined-console-error/14169
**Category:** Phaser 3
**Created:** [April 1, 2024, 11:14pm UTC](https://phaser.discourse.group/t/type-phaser-auto-results-in-phaser-is-not-defined-console-error/14169 "2024-04-01T23:14:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![TheBeardedGoblin](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@TheBeardedGoblin](https://phaser.discourse.group/u/TheBeardedGoblin)
#### Post date: [April 1, 2024, 11:14pm UTC](https://phaser.discourse.group/t/type-phaser-auto-results-in-phaser-is-not-defined-console-error/14169/1 "2024-04-01T23:14:55Z")

</div>

I’m going through the Phaser 3 tutorial at [Making your first Phaser 3 game - Phaser](https://phaser.io/tutorials/making-your-first-phaser-3-game/part1) and I’m running into an issue: when setting up _var config_ the console log is telling me “Phaser is not defined” and it breaks on the bolded line below (Phaser.AUTO):

```javascript
 var config = {
     **type: Phaser.AUTO,**
     width: 800,
     height: 600,
     scene: {
         preload: preload,
         create: create,
         update: update
     }
 };

```

What’s interesting is that I put “console.log(“Phaser Loaded”);” into the top of phaser.js and it logs it correctly, so I’m not sure what the issue is…phaser.js is being loaded. My development environment is Visual Studio 2022 and the project is set up as an [ASP.Net](http://ASP.Net) Core MVC web application.

Here’s the full page of **Views/Home/Index.cshtml** :

```javascript
@{
    ViewData["Title"] = "Phaser Game";
}

<head>
    <meta charset="UTF-8" />
    <title>Phaser Test</title>
</head>

<script type="text/javascript">

    var config = {
        type: Phaser.AUTO,
        width: 800,
        height: 600,
        scene: {
            preload: preload,
            create: create,
            update: update
        }
    };

    var game = new Phaser.Game(config);

    function preload() {
    }

    function create() {
    }

    function update() {
    }

</script>

```

and my **Views/Shared/\_Layout.cshtml** scripts loading:

```javascript
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/phaser.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>

```

Thank you!

---

<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: [April 2, 2024, 4:27pm UTC](https://phaser.discourse.group/t/type-phaser-auto-results-in-phaser-is-not-defined-console-error/14169/2 "2024-04-02T16:27:08Z")

</div>

Is `phaser.js` loaded first?

---

<div class="post-metadata">

### Author: ![TheBeardedGoblin](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@TheBeardedGoblin](https://phaser.discourse.group/u/TheBeardedGoblin)
#### Post date: [April 2, 2024, 7:30pm UTC](https://phaser.discourse.group/t/type-phaser-auto-results-in-phaser-is-not-defined-console-error/14169/3 "2024-04-02T19:30:34Z")

</div>

Whoops, that fixed it. Script loading priority is now:

```javascript
<script src="~/js/preload.js"></script>
<script src="~/js/create.js"></script>
<script src="~/js/update.js"></script>
<script src="~/js/phaser.js"></script>
<script src="~/js/game.js"></script>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>

```

Thanks!
