ReferenceError: IgeClass is not defined

Post your help queries and engine programming questions here

ReferenceError: IgeClass is not defined

Postby PWG » Mon Jul 10, 2017 12:37 am


I'm new to both Node and IGE. I get the following error when trying to use node to run server.js: "ReferenceError: IgeClass is not defined". I'm guessing this is a node config issue. Any help would be appreciated.



A little bit about my setup:

I'm using Vagrant to run an Ubuntu VM. I proxy node using nginx. I verified the node install using a simple HelloWord.js script that runs successfully and emits HTML. I did run npm install ige/server and it seemed to work.

The following is the contents of my webroot:

The following are the installed node packages reported by npm ls:

Posts: 2
Joined: Sun Jul 09, 2017 11:57 pm

Re: ReferenceError: IgeClass is not defined

Postby PWG » Fri Jul 14, 2017 7:04 am

The fix to the above problem really just boiled down to finding the right piece of documentation and reading it. The documentation in question is located at It shows an example of how to run ige from the command line. There are some subtleties that are worth noting.

Run an ige example from the command line looks like this:

In the ige directory:

node ./server/ige -g ./examples/0.0-load-graph

The -g option is an option being passed to the ige script not to node. It doesn't seem to have any extensive documentation but the code that uses it can be found at:

Since the -g option is used by ige and not by node running a script using pm2 looks like this:

pm2 start ./server/ige.js -- -g ./examples/24.2-multiplayer

Notice the .js extension on ige and the double-dash (i.e. --) before the -g option.

The examples like to be run from the directory they live in in the distribution. Copying the examples and making them run from a different directory requires adjustments be made. Most of the examples that require an open port on the server use port 2000. So it's important to forward that port from host to VM.

ige.js uses node to run the game code but not to serve any html or assets. For example to run the multiplayer demo on my setup I (with port 2000 forwarded to 2000 and port 8000 forwarded to port 80) I first launch the example on the server using node then I open a browser and navigate to:

index.html, the associated javascript files, and all of the various assets are served by nginx from the VM. Once the client javascript is loaded and running in the browser it takes over and starts talking to the node process running on the server using port 2000.
Posts: 2
Joined: Sun Jul 09, 2017 11:57 pm

Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest