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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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