Jump to content

phaser not defined but phaser.js import

French Nerd

Recommended Posts

Hi everyone !

I beginning Phaser and javascript today, and something wrong was happened. I have this error :

main.js:1 Uncaught ReferenceError: phaser is not defined.

But I have already import phaser.js (wich contain the Phaser variable) in my index.html, look at my code !


    <!DOCTYPE html>
            <meta charset ="utf-8" />
            <title>My first game</title>
            <script src="js\phaser.js"></script>

                    background: black;

            <script src = "js/main.js"></script>


    var game = new phaser.Game(640,360, Phaser.AUTO);

    var GameState = {
        preload : function(){


        create : function(){


        update : function(){



Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...