magicsunday / webtrees-descendants-chart

SVG based descendants chart module for webtrees genealogy application.
GNU General Public License v3.0
27 stars 9 forks source link

Uncaught DOMException: Failed to execute 'setItem' on 'Storage' #57

Closed magicsunday closed 7 months ago

magicsunday commented 7 months ago

Well, the latest version from branch 2.1 works fine on my local install (wampserver php 8.2.13 / 8.3.0) Testing on my live site running php 8.1.27, I only got a spinning wheel and following console message:

Uncaught DOMException: Failed to execute 'setItem' on 'Storage': Setting the value of 'webtrees-descendants-chart' exceeded the quota. at e.Storage.write (https://visitusinmaputo.com/webtree/module/_webtrees-descendants-chart_/Asset?asset=js%2Fdescendants-chart-storage.min.js&hash=1712089392:1:573) at e.Storage.onInput (https://visitusinmaputo.com/webtree/module/_webtrees-descendants-chart_/Asset?asset=js%2Fdescendants-chart-storage.min.js&hash=1712089392:1:410) at e.Storage.register (https://visitusinmaputo.com/webtree/module/_webtrees-descendants-chart_/Asset?asset=js%2Fdescendants-chart-storage.min.js&hash=1712089392:1:297) at https://visitusinmaputo.com/webtree/tree/familie/webtrees-descendants-chart/I5785:896:9

Pedigree and fanchart with latest fix works fine when testing on live site.

Originally posted by @HRN65 in https://github.com/magicsunday/webtrees-descendants-chart/issues/56#issuecomment-2033048970

HRN65 commented 7 months ago

Update I now get the same error in pedigree chart

magicsunday commented 7 months ago

The call on your site works for me in Chrome and Firefox. I get errors from Module argon (https://visitusinmaputo.com/webtree/module/_argon_/Asset?asset=js%2Ftheme.js&hash=1678289637) instead:

TypeError: document.getElementById(...) is null Uncaught TypeError: Cannot read properties of null (reading 'offsetHeight')

According to https://stackoverflow.com/questions/23977690/setting-the-value-of-dataurl-exceeded-the-quota the memory in the browser seems to be full. In an answer (https://stackoverflow.com/a/77693369/1111654) someone posted a javascript that shows the size of a page's LocalStorage. Feel free to run this on the Webtrees LIVE installation in the console and see what it outputs.

In which browser does the problem occur?

HRN65 commented 7 months ago

My live site is now back on descendants chart 1.8.1, thus you do not see the error. You may see it in pedigree chart. Here I get the error in Chrome. In Firefox and Vivaldi there is no error

magicsunday commented 7 months ago

I added a try/catch block around the call to setItem to prevent the error. Could you please test it with latest version from branch 2.1?

HRN65 commented 7 months ago

Thank you! I have no access to computer at the moment, but will test later today.

HRN65 commented 7 months ago

Live site is now running latest version from 2.1 (descendant-, pedigree- and fanchart) Layout and names looks fine, and I see no errors when testing in different browsers.

Thank you very much Rico!