Page 1 of 1

Stuck at Application Loading...

Posted: 21 November 2022, 18:51
by derby-digital
Hi there,

I'm finalizing the development of my first BGA game and I'm facing a problem that I don't understand.

I've read the docs, but can't find any indication of what might be going on.

Some players are faced with an error message when launching the game:
Stick at Application Loading...

You can see the issue here :
https://boardgamearena.com/2/rallymandi ... =312535713

I think it's related to the spectator mode but I can't find any info on why it crashes on launch.

The console has an error message that is not more explicit:

During pageload
l is null

If anyone has any clue to help me...

Thanks


----

Bonjour à tous,

je finalise le développement de mon premier jeu BGA et je suis face à un problème que je ne comprends pas.

J'ai lu la doc, mais je ne trouve aucune indication sur ce qu'il peut se passer.

Certains joueurs se retrouvent devant un message d'erreur au lancement du jeu :
Stuck at Application Loading...

Lorsque j'appuie pour voir une partie, le message apparait :
https://boardgamearena.com/2/rallymandi ... =312535713

je pense que c'est le mode spectateur mais je ne trouve aucune info sur pourquoi ca bloque au lancement.

La console a un message d'erreur qui n'est pas plus explicite :

During pageload
l is null

Si quelqu'un a la moindre piste pour m'aider ...

Merci

Re: Stuck at Application Loading...

Posted: 22 November 2022, 08:31
by ufm
Probably your game is loading something spectators cannot access even in spectator mode.
(eg. private info of player like cards in hand, objectives, etc.)
Use this.isSpectator to prevent spectators from trying to access those data.

Re: Stuck at Application Loading...

Posted: 22 November 2022, 10:48
by SwHawk
derby-digital wrote: 21 November 2022, 18:51
During pageload
l is null

If anyone has any clue to help me...

Thanks
The full error stack should appear in the browser's development tools which then will show you the exact line (or rather column since on prod JS files are minified) where that statement doesn't behave as expected.

Though I'm inclined towards two possible causes : a dojo.place/this.format_block with a missing argument, or a dojo function needing a HTMLElement and not getting any (a typo/error with the ID being selected).

Re: Stuck at Application Loading...

Posted: 23 November 2022, 14:41
by derby-digital
Thanks for your help.

The console log is not very helpful :

During pageload
l is null
dojo/string/</o.substitute/<@https://x.boardgamearena.net/data/theme ... js:1:52867
dojo/string/</o.substitute@https://x.boardgamearena.net/data/theme ... js:1:52614
format_block@https://x.boardgamearena.net/data/theme ... s:1:332571
setup@https://x.boardgamearena.net/data/theme ... .js:1:3808
completesetup@https://x.boardgamearena.net/data/theme ... s:1:496496
@https://boardgamearena.com/2/rallymandi ... 13:2498:24
He/<@https://x.boardgamearena.net/data/theme ... .js:1:9669
He@https://x.boardgamearena.net/data/theme ... .js:1:9739
We/<@https://x.boardgamearena.net/data/theme ... .js:1:9935
Xe@https://x.boardgamearena.net/data/theme ... .js:1:9797
We@https://x.boardgamearena.net/data/theme ... .js:1:9871
r@https://x.boardgamearena.net/data/theme ... js:1:11030
h.injectUrl/o<@https://x.boardgamearena.net/data/theme ... js:1:13285

During my investigation, it appear I have a similar issue when you want to be spectator of a game :

During pageload
e.players[this.player_id] is undefined
setup@https://x.boardgamearena.net/data/theme ... .js:1:3848
completesetup@https://x.boardgamearena.net/data/theme ... s:1:496496
@https://boardgamearena.com/2/rallymandi ... 75:2408:24
He/<@https://x.boardgamearena.net/data/theme ... .js:1:9669
He@https://x.boardgamearena.net/data/theme ... .js:1:9739
We/<@https://x.boardgamearena.net/data/theme ... .js:1:9935
Xe@https://x.boardgamearena.net/data/theme ... .js:1:9797
We@https://x.boardgamearena.net/data/theme ... .js:1:9871
r@https://x.boardgamearena.net/data/theme ... js:1:11030
h.injectUrl/o<@https://x.boardgamearena.net/data/theme ... js:1:13285

I cant be sure but i seems to be related.

Re: Stuck at Application Loading...

Posted: 23 November 2022, 15:46
by SwHawk
derby-digital wrote: 23 November 2022, 14:41 Thanks for your help.

The console log is not very helpful :

During pageload
l is null
dojo/string/</o.substitute/<@https://x.boardgamearena.net/data/theme ... js:1:52867
dojo/string/</o.substitute@https://x.boardgamearena.net/data/theme ... js:1:52614
format_block@https://x.boardgamearena.net/data/theme ... s:1:332571
setup@https://x.boardgamearena.net/data/theme ... .js:1:3808
completesetup@https://x.boardgamearena.net/data/theme ... s:1:496496
@https://boardgamearena.com/2/rallymandi ... 13:2498:24
He/<@https://x.boardgamearena.net/data/theme ... .js:1:9669
He@https://x.boardgamearena.net/data/theme ... .js:1:9739
We/<@https://x.boardgamearena.net/data/theme ... .js:1:9935
Xe@https://x.boardgamearena.net/data/theme ... .js:1:9797
We@https://x.boardgamearena.net/data/theme ... .js:1:9871
r@https://x.boardgamearena.net/data/theme ... js:1:11030
h.injectUrl/o<@https://x.boardgamearena.net/data/theme ... js:1:13285
Looking at the log is actually helpful, if you focus on the setup line, it tells you that the problematic statement is this one :

Code: Select all

for(var i in e.players){var a=e.players[i];a.on_track&&t.place(this.format_block("jstpl_car",a),$("board"))}
And the column indicates that this happens in the format_block call, so basically there is at least one key that doesn't have a value...

Which you should be able to locate easily in your source JS.

EDIT : error trace always indicate the file the error has been encountered in followed by a colon the the line number in the file of the statement that threw the error then another colon then the column number in the line...
Clearly a spectator isn't referenced in gamedatas.players object, so trying to access their info is going to fail, so you need to enclose the corresponding statements in a check for spectators...

Re: Stuck at Application Loading...

Posted: 30 November 2022, 15:43
by derby-digital
Thanks SwHawk !

The minified files doesnt help but I found the bug, thanks to you.

It was not in the format_block but in a console log I used.

Thanks again for your help !!