Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Crys

Currently I'm setting up impact using Chrome and after unpacking in the webserver's root directory I get this error when I open weltmister:

"Uncaught Failed to load entity list via glob.php: SyntaxError: Unexpected token <
<?php
require_once( 'config.php' );"

(then describes the code from the glob.php file)

"Uncaught Unresolved (circular?) dependencies. Most likely there's a name/path mismatch for one of the listed modules:
weltmeister.weltmeister (requires: weltmeister.edit-entities)
weltmeister.edit-entities (requires: weltmeister.entities)"

I noticed some posts were similar to this error but I was unable to fix it, I think I'm missing something here...

1 decade ago by dominic

It seems that you webserver isn't running PHP. What OS and webserver are you using? How did you install the webserver?


Try creating a file called info.php in your webserver's root with the following contents:
<?php phpinfo(); ?>

If you navigate to this file in your browser you should see a detailed listing of the installed PHP version - if PHP is running correctly.

1 decade ago by Crys

I created the info.php and yes the PHP wasn't setup correctly and so I went through the the PHP setup process again and it's working now. Thank you for the help!

1 decade ago by Rob_The_Wise

I had this problem. And thanks to this post I was able to get it working too :-)

For anyone using windows Vista do NOT install PHP to your program files directory. This seemed to be the cause of this particular problem for me.

Install your PHP to C:\PHP if you run Windows Vista.

1 decade ago by CACUser

I get the same error. But my php seems to be working. Could there be another cause for tyhis. I tried to install the Pong game and tried to see it in Weltmeister

1 decade ago by CACUser

The following is more information on the error I am seeing:

The exact error message is "Uncaught Syntax Error: Unexpected Token <" in jquery min at 248. On expanding this is the error:
jquery-1.4.2.min.js:248Uncaught SyntaxError: Unexpected token <
$.parseJSONjquery-1.4.2.min.js:248
wm.Weltmeister.ig.Class.extend.loadResponseweltmeister.js:248
(anonymous function)impact.js:54
bjquery-1.4.2.min.js:124
c.extend.ajax.g.x.onreadystatechangejquery-1.4.2.min.js:129
c.extend.ajaxjquery-1.4.2.min.js:130
wm.Weltmeister.ig.Class.extend.loadweltmeister.js:235
wm.Weltmeister.ig.Class.extend.initweltmeister.js:120
Classimpact.js:423
wm.Loader.ig.Loader.extend.endweltmeister.js:814
(anonymous function)

Any idea how to fix this issue?

1 decade ago by dominic

When exactly does this happen? When you try to load a level?

It's probably a problem with your PHP configuration. Use your browser's console to look what the AJAX request returns. There's probably be a PHP error or warning somewhere, instead of the expected JSON data.

Can you load this file? (assuming you installed impact in htdocs/impact/):
http://127.0.0.1/impact/lib/weltmeister/api/glob.php?glob[]=lib%2Fgame%2Fentities%2F*.js

It should return a list of files, or [] if no files were found.

1 decade ago by CACUser

It returns a list of files:

["lib\/game\/entities\/paddle-cpu.js","lib\/game\/entities\/paddle-player.js","lib\/game\/entities\/paddle.js","lib\/game\/entities\/puck.js"]

I will also check what error, if any the browser is returning and post it soon

1 decade ago by FlynnBoyO

I have been reading threads all day trying to get this stuff set up. I am prety sure apache and php are working correctly. When I goto that URL the error I get is:

Fatal error: Call to undefined function json_encode() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\impact\lib\weltmeister\api\glob.php on line 16

As it is the weltmiester just sits there limply, none of the buttons do anything and no data is populated.

1 decade ago by LaserBeam

I had the same issue. In my case I had a syntax error in my code. So, check your code for syntax errors. Hope that helps.

1 decade ago by Arantor

If you don't have json_ecode, it means your PHP is running a version prior to 5.2.0 where json_encode and json_decode should be built in functions after that.

1 decade ago by FlynnBoyO

When I look at my info.php file it says PHP Version 5.2.4RC3-dev is the version.

1 decade ago by Arantor

You're using a 4 and a half year old version of PHP, you really should upgrade. But because you're using a dev/release candidate, it's almost certainly been disabled during the build process.

1 decade ago by FlynnBoyO

Cool. It was my php install. Everything is working now. Thanks for the help!!

1 decade ago by psydack

My php is running correctly:

info.php = PHP Version 5.3.1

Why here I got this error:

Uncaught SyntaxError: Unexpected token <

My glob.php is correct, returning:
["lib\/game\/entities\/player.js","lib\/game\/entities\/spike.js"]

Xampp on Mac. All persmissions allowed.

If someone have more tipes...

1 decade ago by dominic

psydack: where do you see this error message? Which file?

1 decade ago by Jerczu

Double check your code if you closed off all the parenthesis etc. From experience its probably a mistake in main.js or entity files.

1 decade ago by psydack

Thanks for reply.

@dominic: In dev console. When I tried to load a level (jumpnrun example and drop demo). Both with same error. I tried putting a empty project (it's works!) but when I access weltmeister.html and click new, it return the same error.

@Jerczu: I bought impactjs yesterday, so I tried run the example packages (jumnrun and drop) but both still with same error. Then I tried put empty project and start a new level but the same error. I don't know but this looks like to me some jquery exception.

All games works, only level is crashed.

Thanks for reply, I really don't know what's happen.

1 decade ago by psydack

The full error code from (jump and run example) http://localhost/jumpnrun/weltmeister.html:

Uncaught SyntaxError: Unexpected token <
$.parseJSON - jquery-1.4.2.min.js:248
wm.Weltmeister.ig.Class.extend.loadResponse - weltmeister.js:250
(anonymous function) - impact.js:62
bj - query-1.4.2.min.js:124
c.extend.ajax.x.onreadystatechange - jquery-1.4.2.min.js:129
c.extend.ajax - jquery-1.4.2.min.js:130
wm.Weltmeister.ig.Class.extend.load - weltmeister.js:237
wm.Weltmeister.ig.Class.extend.init - weltmeister.js:122
Class - impact.js:431
wm.Loader.ig.Loader.extend.end - weltmeister.js:848
(anonymous function) - impact.js:62

Someone have the same issue?

1 decade ago by dominic

The error is in jQuery&039;s #$.parseJSON function - so it has to be an error in one of the .php files loaded via Ajax. Open the Network/Ajax tab in your browser&039;s dev tools and look at the responses for each of the Ajax requests to the #.php files.

1 decade ago by psydack

Thanks dominic for reply.

So I tried and I saw jquery is returnig a eval.
That's the return and the error:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /jumpnrun/lib/game/levels</title>
 </head>
 <body>
<h1>Index of /jumpnrun/lib/game/levels</h1>
<ul><li><a href="/jumpnrun/lib/game/"> Parent Directory</a></li>
<li><a href="test.js"> test.js</a></li>
</ul>
<address>Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 80</address>
</body></html>

I don't know what to do. I will continue too find the error. I think I close.

1 decade ago by dominic

That's really strange. What's the requested URL for that response?

Try setting the loadLastLevel property in your lib/weltmeister/config.js to false. Maybe WM is trying to load a (non-existent) level and gets the directory listing instead of an error code!?

1 decade ago by psydack

For other person what got the same error look the EDIT 4 in this post. =)

@dominic When I load it try to load this url: http://localhost/jumpnrun/lib/game/levels/?nocache=0.6802967314142734

I tried setting loadLastLevel to false but I get the same error. =/

Well, I don&039;t know but it's like some jquery error in #return eval(v) (almost line 250 in jquery). When load that html above with alert it appears a strange character in the end, a square (just in Windows OS). Like this:
$.parseJSON = function(v, safe) {
	if (safe === undefined) safe = $.parseJSON.safe;
	if (safe && !/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v))
		return undefined;
	alert(v);
	return eval('('+v+')');
};

I'll try changing some things more often, but I don't know if I can do something. I try to install apache (without these Mamp Xampp).

Thanks for reply man. =)

Sorry for my english.

EDIT: I almost sure the error is in parse the html to json. Cause I tried to replace < to 0 and the error is in next character !. The same error: Uncaught SyntaxError:

EDIT 2: Maybe it loading the wrong js. I getting this HTML but this should get a javascript test.js right?

EDIT 3: Ok dominic I found the error. The path in weltmeister.js is getting wrong file. This work (but this is temporary) in line 231 (//loading) the fileName is undefined:
load: function( dialog, path ) {
	$.cookie( 'wmLastLevel', path );
	this.filePath = path;
	this.saveDialog.setPath( path );
	this.fileName = path.replace(/^.*\//,'');
	alert(path);
	var req = $.ajax({
		url:( path + 'test.js?nocache=' + Math.random() ), 
		dataType: 'text',
		async:false,
		success:this.loadResponse.bind(this)
	});
},

Now I need your help to get the right place.

EDIT 4: The error is I tried to load the folder and not the file. How stupid I'm.

Tip for other to get the same error: Just click in path (when the dialog is open) and select your level.

Sorry for troubles. =)
Page 1 of 1
« first « previous next › last »