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 alexandre

Not sure why but bake.sh just started inserting a BOM (byte order mark) character in my project's game.min.js file, always at the same point (baked portion for one of the game's level files), making it unloadable by Chrome and other clients, who then report an Unexpected token ILLEGAL error.

Editing main.js, removing all references to the level the BOM seems to target, and rebaking merely shifts the BOM to another place in game.min.js

Editing game.mini.js and removing the problematic character (0xFEFF) fixes the problem. The game can then be loaded. But that's not a solution.

Any advice much appreciated.

1 decade ago by Arantor

Load all the unbaked files in a competent text editor like Notepad++ and tell it to convert to UTF-8 without BOM, then resave.

1 decade ago by alexandre

Thanks for the hint Arantor.

So many files though, so instead ran this command, which returns culprit names and relevant lines, highlighted in red:
find .  -type f -name *.js -exec grep -H --color='auto' -P -n "[\x80-\xFF]" {} \;

After editing/cleanup of the files, bake.sh once again returns "healthy" minified games.

Incidentally, the impactEvents plugin available from POI contains one such marker, making games baked with it unlaunchable. Will need fixing at the source (@omatase).

1 decade ago by beardedbuddha

Are you sure that the page with your game in it has the correct encoding metatag?

1 decade ago by alexandre

Dammit! I had forgotten my utf-8 charset meta and that alone was enough to fix it.

And 2 hours wasted because I forgot that one simple check. :\

Thank you, bearded buddha (and a well chosen moniker, that). :)
Page 1 of 1
« first « previous next › last »