Closed ondrejj closed 4 years ago
This is strange, I can't reproduce the bug.
I have uploaded a version of the program at https://brython.info/tests/issue1516/, only modifying some links, and adding at line 148 of engine.py
:
def json_loaded(req):
p.map_json = JSON.parse(req.text)
map_json_file = "map.json?%s" % time.time()
ajax.get(map_json_file, blocking=True, oncomplete=json_loaded)
this.load.tilemapTiledJSON("level1", map_json_file)
print(p.map_json["tilesets"]) # line added for debugging
The data actually shows in the browser console. The rest of the method fails, but that's because I didn't copy/paste the images and sounds.
I am sorry, looks like again my problem. brython_stdlib.js needs to be updated after install. I have to change my install script to do this automatically.
May be it would be useful to somehow detect this and write an error. For example save an build version at creation time and check it on load.
I am testing your new version from git and failing with this error:
Looks like this commit caused the problem: https://github.com/brython-dev/brython/commit/d242edfcae9b61900ceeb9abd9a40eed8885b6be
Not sure, what exactly is the problem, but here is part of my code:
And looks like json_loaded is not called before last line, but there is an "ajax.get(...blocking=True), so this should be blocked until this function is complete.
Older versions works well.