Console error when uploading game on Kongregate

Hello!

I exported my project as a HTML5 game and uploaded it to Kongregate. When I launch the preview of the game, I get a 100% upload on the game’s screen, but the game won’t start. I get the three following error messages in my console:

  1. Failed to load resource: the server responded with a status of 404 (): /game_ratings.json?game_id=318050:1

storagetools.js:16
Uncaught DOMException: Failed to read the ‘localStorage’ property from ‘Window’: Access is denied for this document.
at https://game318050.konggames.com/gamez/0031/8050/preview/events-tools/storagetools.js:16:66

  1. Uncaught TypeError: Cannot read property ‘loadJSONFileFromStorage’ of undefined
    at Object.gdjs.IntroCode.eventsList0x7a8cdc (code0.js:73)
    at Object.gdjs.IntroCode.eventsList0x5b6e18 (code0.js:276)
    at gdjs.RuntimeScene.gdjs.IntroCode.func [as _eventsFunction] (code0.js:331)
    at gdjs.RuntimeScene.renderAndStep (runtimescene.js:296)
    at gdjs.SceneStack.step (scenestack.js:39)
    at runtimegame.js:471
    at gameLoop (runtimegame-pixi-renderer.js:427)

Does someone know what these error messages refer to and how to overcome them?

Thanks a lot!
GingerBread

Hi,
Try another browser, perhaps.
What actions did you use for save/load if you have such a thing? filesystem, storage, memory?

1 Like

Hi,
Thank you for your assistance once again! So I tried three different browsers: the game seems to work fine in both Firefox and Safari, but has the problem mentioned above when opened in Google Chrome.

I have a save system in my game: when a player arrives on the intro screen of the game, I load the storage ‘save’ in memory, I read each global variable and transfer it to a scene variable, close the storage, then transfer each scene variable’s value to the adequate global variable.
Then, every time the player changes from one scene to another, I call a SaveData function, which writes in the storage ‘save’ the current value for each global variable.
This works fine when played in GDevelop and when exported as a Desktop app for both Mac and Windows, and seems to work as whttps://forum.gdevelop.io/t/console-error-when-uploading-game-on-kongregate/23937ell on Safari and Google Crome.

Any idea on how I could improve it so my game also plays successfully on Google Chrome?

Thanks again :slight_smile:

This seems like both a limitation of Kongregate and a bug in the storage extension. The limitation is that Kongregate locks storage and the bug is that storage hasn’t any fallback code for when it is not available.

1 Like

Very strange that it doesn’t work on Chrome since GDevelop uses Chrome for the preview. :thinking:
What you could try is hosting on Kongregate the storage example project, to check how it works compared to your own project. This should tell us if there’s something wrong with your events.

@arthuro555 it wouldn’t work on Firefox if it was a limitation of Kongregate, right?

1 Like

Ok I checked, it’s because of a security settings. You must have some sort of script blocker or disabled some cookies.

1 Like

Alright!

So, I reseted the settings for my Google Chrome, without success. Then, I deactivated the cookies filter that was on… and it worked!
The console still displays two out of the three error messages mentioned previously, only that one disappeared:

storagetools.js:16
Uncaught DOMException: Failed to read the ‘localStorage’ property from ‘Window’: Access is denied for this document.
at https://game318050.konggames.com/gamez/0031/8050/preview/events-tools/storagetools.js:16:66

However, I wonder wether other players will face the same difficulty while playing on chrome?

By the way, while testing the game on different browsers, I noticed that in Firefox, pressing the arrow keys while in a scene using a text entry object produces the characters “&”, " ’ ", “%” and “(”, which is not the case in other browsers.

Do you have any idea of the reason why?

Thanks for your help anyway! :slight_smile:

The text object was always since the implementation of browser support in GD buggy on firefox. Maybe the soon to be update of the renderer will fix that?

1 Like

I see! I’m relieved because I thought it might be a mistake in my game’s events causing that but I really couldn’t find anything that made sense in that direction!

Case solved then, thanks a lot to you @arthuro555 and to you @Gruk for your support! :smile:

GingerBread

2 Likes