Issues using Dictonary & Web Storage for saving the game

0 favourites
  • 6 posts
From the Asset Store
Basic Plugins for Firebase Authentication, Realtime-Database, Firestore, Cloud Storage
  • Hi,

    at one point in my development my local storage stopped working. I didn't really change anything about it so I'm not sure what is causing this but the console error that I'm getting is this:

    Unable to use local storage, reverting to in-memory store: DOMException: A mutation operation was attempted on a database that did not allow mutations. A mutation operation was attempted on a database that did not allow mutations. 01997124-d4af-418b-b711-bcbc7ef7b3aa:3:253
     _MaybeSwitchToMemoryFallback blob:https://preview.construct.net/01997124-d4af-418b-b711-bcbc7ef7b3aa:3
     getItem blob:https://preview.construct.net/01997124-d4af-418b-b711-bcbc7ef7b3aa:4
     CheckItemExists blob:https://preview.construct.net/2ff66fae-276a-4203-bb9c-b73659fb5761:5
     _RunActions_ReturnValue blob:https://preview.construct.net/a75ee092-f4bf-45f4-b5fd-9c4ab1fc25c3:26
     _RunAndBlock blob:https://preview.construct.net/a75ee092-f4bf-45f4-b5fd-9c4ab1fc25c3:23
     Run blob:https://preview.construct.net/a75ee092-f4bf-45f4-b5fd-9c4ab1fc25c3:20
     _ExecuteTrigger blob:https://preview.construct.net/26c61692-7c56-4d71-a0cb-96939271dcf2:18
     _TriggerForClass blob:https://preview.construct.net/26c61692-7c56-4d71-a0cb-96939271dcf2:12
     _Trigger blob:https://preview.construct.net/26c61692-7c56-4d71-a0cb-96939271dcf2:11
     _Trigger blob:https://preview.construct.net/0b227ecc-4b8a-45ea-803d-36c7156a0ef5:13
     Trigger blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:81
     TriggerAsync blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:82
     _StartRunning blob:https://preview.construct.net/8b0b727a-b854-4348-b3f7-f7afb5063f34:15
     _DoChangeLayout blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:78
     _MaybeChangeLayout blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:75
     Tick blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:68
     normal blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:6
     id blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     RequestPostAnimationFrame blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     _RequestAnimationFrame blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:61
     Tick blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:68
     normal blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:6
     id blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     RequestPostAnimationFrame blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     _RequestAnimationFrame blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:61
     Tick blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:68
     normal blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:6
     id blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     RequestPostAnimationFrame blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     _RequestAnimationFrame blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:61
     Tick blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:68
     normal blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:6
     id blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     RequestPostAnimationFrame blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     _RequestAnimationFrame blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:61
     Tick blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:68
     normal blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:6
     id blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     RequestPostAnimationFrame blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18
     _RequestAnimationFrame blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:61
     Tick blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:68
     normal blob:https://preview.construct.net/2a98e0ee-c496-4714-98d0-c40caa5b8e61:6
     id blob:https://preview.construct.net/bb598e4b-22ea-45d0-bd8a-db50bc03b857:18

    At the start of the game I'm doing this:

    the only other time I touch local storage is here (this does not get called when the error is thrown into the console, it gets thrown at the start of the game)

    and here are the project settings I'm using:

  • Does this happen on other computers or browsers? Try temporarily adding "Local Storage Clear" to the very start of the project and run once. If LS is corrupted, this should fix it.

  • That error ("A mutation operation was attempted on a database...") is what you get when you disable websites being able to store any data locally in Firefox settings. I think the option is called "never remember history" or something, or it might be some other tracking prevention feature. If you block any website storing data, then your project can't store any data either.

  • Hi thanks for the answers,

    it is definitely not Firefox's fault. I run into the same issue on microsoft edge.

    If you could check out the console output yourselves here is the link to the game: newgrounds.com/portal/view/786047

    And here is the .c3p file of the game: mega.nz/file/JFgxRQ4Y

    Here is the console log:

    [Construct 3] Error parsing JSON: SyntaxError: Unexpected token d in JSON at position 0
     at JSON.parse (<anonymous>)
     at DictionaryInstance.JSONLoad (c3runtime.js:2962)
     at Action._RunObject_ParamsDontVary (c3runtime.js:1827)
     at EventBlock._RunActions_Fast (c3runtime.js:1694)
     at EventBlock._RunAndBlock (c3runtime.js:1692)
     at EventBlock.Run (c3runtime.js:1689)
     at EventSheet._ExecuteTrigger (c3runtime.js:1662)
     at EventSheet._TriggerForClass (c3runtime.js:1656)
     at EventSheet._Trigger (c3runtime.js:1655)
     at EventSheetManager._Trigger (c3runtime.js:1626)
    JSONLoad  c3runtime.js:2962
    _RunObject_ParamsDontVary  c3runtime.js:1827
    _RunActions_Fast  c3runtime.js:1694
    _RunAndBlock  c3runtime.js:1692
    Run  c3runtime.js:1689
    _ExecuteTrigger  c3runtime.js:1662
    _TriggerForClass  c3runtime.js:1656
    _Trigger  c3runtime.js:1655
    _Trigger  c3runtime.js:1626
    Trigger  c3runtime.js:2383
    TriggerAsync  c3runtime.js:2384
    TriggerAsync  c3runtime.js:1930
    (anonymous)  c3runtime.js:2989
    _MaybeStartNext  c3runtime.js:572
    (anonymous)  c3runtime.js:571
    Add  c3runtime.js:571
    ScheduleTriggers  c3runtime.js:2386
    ScheduleTriggers  c3runtime.js:1930
    CheckItemExists  c3runtime.js:2989
    async function (async)
    CheckItemExists  c3runtime.js:2988
    _RunActions_ReturnValue  c3runtime.js:1695
    _RunAndBlock  c3runtime.js:1692
    Run  c3runtime.js:1689
    _ExecuteTrigger  c3runtime.js:1662
    _TriggerForClass  c3runtime.js:1656
    _Trigger  c3runtime.js:1655
    _Trigger  c3runtime.js:1626
    Trigger  c3runtime.js:2383
    TriggerAsync  c3runtime.js:2384
    _StartRunning  c3runtime.js:1150
    async function (async)
    _StartRunning  c3runtime.js:1149
    _DoChangeLayout  c3runtime.js:2380
    async function (async)
    _DoChangeLayout  c3runtime.js:2379
    _MaybeChangeLayout  c3runtime.js:2377
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
    requestAnimationFrame (async)
    RequestPostAnimationFrame  c3runtime.js:355
    _RequestAnimationFrame  c3runtime.js:2363
    Tick  c3runtime.js:2370
    normal  c3runtime.js:2308
    (anonymous)  c3runtime.js:355
    async function (async)
    (anonymous)  c3runtime.js:355
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Your last post has a different error message, so looks like an unrelated issue.

    I am pretty sure that if you get an error writing to storage, it's because the browser settings have been changed to block storage.

  • Thanks for the responses!

    The issue was not with browsers, it was with my code.

    I was trying to load LocalStorage.Key instead of LocalStorage.ItemValue

    It works now!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)