Javascript error while running a browser-desktop game

63 views
Skip to first unread message

Baris Ayaz

unread,
Feb 16, 2015, 12:13:38 PM2/16/15
to game-clos...@googlegroups.com
Hello,

I'm getting the following errors when I try to start a "browser-desktop" generated game.

Application Cache Error event: Resource fetch failed (404) http://localhost/mygame/_resources
Uncaught TypeError: Cannot set property '__root' of undefined


The following command is used to build the project.

devkit release browser-desktop -u http://localhost/mygame/

The project is build with devkit v.2.1.1.

Running the same project in the simulator either as an native-ios app has no issues.
Any ideas what I'm missing to deploy a "browser-desktop" deployment?


Thx



Collin Green

unread,
Feb 16, 2015, 3:23:04 PM2/16/15
to game-clos...@googlegroups.com
Hi Baris,

I'd like to reproduce your error locally and fix it, but I haven't been able to yet.

What is the -u http://localhost/mygame for and/or what do you have set up there for resources?


I successfully made a browser-desktop build of the demoAnimation project with the following commands:

git clone g...@github.com:gameclosure/demoAnimations
cd demoAnimations
devkit install
devkit debug browser-desktop

Then I hosted it locally with this:
cd build/debug/browser-desktop
python -m SimpleHTTPServer

Then the demo works in my browser at localhost:8000

Do you have the same error if you do these steps with the demoAnimations project?

Michael Boulet

unread,
Mar 11, 2016, 12:30:54 PM3/11/16
to Game Closure DevKit
I also have the problem when doing a release build. Works fine with a debug build. I'm using devkit 3.1.3.

Tom Geiger

unread,
May 17, 2016, 12:43:01 PM5/17/16
to Game Closure DevKit
Hi, I am still experiencing this problem when I try to create a release build of the "Platformer" demo game.

Steps to reproduce:


2. init devkit:
devkit install

3. make release build:
devkit release browser-desktop

4. Open index.html (served on local apache server) results in console error:

start-app failed TypeError: Cannot set property '__root' of undefined
    at Object.window.GC_LOADER.controller.pipeline.call (http://localhost/release/browser-desktop/game.html:185:11)

When creating a debug-build using "devkit debug browser-desktop" the game starts up fine.

Any ideas what's going wrong there?

Tom Geiger

unread,
May 26, 2016, 9:30:46 AM5/26/16
to Game Closure DevKit
It turned out that the "const" variables in the platformer demo's Application.js were causing the faulty build. After I changed each of them to var, the release build was working.
Reply all
Reply to author
Forward
0 new messages